Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,7 @@ import gradio as gr
|
|
5 |
openai.api_key = os.getenv("mykey2")
|
6 |
|
7 |
|
8 |
-
messages = [{"role": "system", "content": "You are a
|
9 |
|
10 |
def CustomChatGPT(user_input):
|
11 |
messages.append({"role": "user", "content": user_input})
|
@@ -17,9 +17,8 @@ def CustomChatGPT(user_input):
|
|
17 |
messages.append({"role": "assistant", "content": ChatGPT_reply})
|
18 |
return ChatGPT_reply
|
19 |
|
20 |
-
|
21 |
-
title = "I am ready to answer any of your question."
|
22 |
|
23 |
-
demo = gr.Interface(fn=CustomChatGPT,
|
24 |
|
25 |
demo.launch()
|
|
|
5 |
openai.api_key = os.getenv("mykey2")
|
6 |
|
7 |
|
8 |
+
messages = [{"role": "system", "content": "You are a genius an can answer every question like a philosoph."}]
|
9 |
|
10 |
def CustomChatGPT(user_input):
|
11 |
messages.append({"role": "user", "content": user_input})
|
|
|
17 |
messages.append({"role": "assistant", "content": ChatGPT_reply})
|
18 |
return ChatGPT_reply
|
19 |
|
20 |
+
title = "Ask any question."
|
|
|
21 |
|
22 |
+
demo = gr.Interface(fn=CustomChatGPT, title = title, inputs = gr.inputs.Textbox(label = "Question", placeholder="E.g. What is the tallest building in the world?"), outputs = gr.outputs.Textbox(label = "Answer"))
|
23 |
|
24 |
demo.launch()
|