Update app.py
Browse files
app.py
CHANGED
@@ -9,7 +9,7 @@ from langchain.schema import HumanMessage, SystemMessage, AIMessage
|
|
9 |
if "OPENAI_API_KEY" not in os.environ or os.environ["OPENAI_API_KEY"] == "":
|
10 |
def init_api_key(key):
|
11 |
os.environ["OPENAI_API_KEY"] = key
|
12 |
-
gr.Interface( fn=init_api_key, inputs=["text"], outputs = None).launch(
|
13 |
openai_key = os.getenv("OPENAI_API_KEY")
|
14 |
|
15 |
chat1 = ChatOpenAI(temperature=0.9, openai_api_key=openai_key)
|
@@ -97,5 +97,5 @@ def initialize(name1, name2, iterations):
|
|
97 |
return format_chat(chat_history)
|
98 |
demo = gr.Interface( fn=initialize, inputs=["text", "text", gr.Number(minimum=1, maximum=50, step=1)], outputs =gr.outputs.HTML(label="Chat"))
|
99 |
|
100 |
-
demo.launch(
|
101 |
|
|
|
9 |
if "OPENAI_API_KEY" not in os.environ or os.environ["OPENAI_API_KEY"] == "":
|
10 |
def init_api_key(key):
|
11 |
os.environ["OPENAI_API_KEY"] = key
|
12 |
+
gr.Interface( fn=init_api_key, inputs=["text"], outputs = None).launch()
|
13 |
openai_key = os.getenv("OPENAI_API_KEY")
|
14 |
|
15 |
chat1 = ChatOpenAI(temperature=0.9, openai_api_key=openai_key)
|
|
|
97 |
return format_chat(chat_history)
|
98 |
demo = gr.Interface( fn=initialize, inputs=["text", "text", gr.Number(minimum=1, maximum=50, step=1)], outputs =gr.outputs.HTML(label="Chat"))
|
99 |
|
100 |
+
demo.launch()
|
101 |
|