Update app.py
Browse files
app.py
CHANGED
@@ -8,8 +8,8 @@ messages = [{"role": "system", "content": "You are a Web3 and cryptocurrency exp
|
|
8 |
def CustomChatGPT(user_input):
|
9 |
messages.append({"role": "user", "content": user_input})
|
10 |
response = openai.ChatCompletion.create(
|
11 |
-
model
|
12 |
-
messages
|
13 |
)
|
14 |
ChatGPT_reply = response["choices"][0]["message"]["content"]
|
15 |
messages.append({"role": "assistant", "content": ChatGPT_reply})
|
@@ -18,7 +18,7 @@ def CustomChatGPT(user_input):
|
|
18 |
demo = gr.Interface(
|
19 |
fn=CustomChatGPT,
|
20 |
inputs=gr.inputs.Text(label="Ask a question"), # Add a label to the input component
|
21 |
-
|
22 |
title="Web(GPT)3 Daily"
|
23 |
)
|
24 |
|
|
|
8 |
def CustomChatGPT(user_input):
|
9 |
messages.append({"role": "user", "content": user_input})
|
10 |
response = openai.ChatCompletion.create(
|
11 |
+
model="gpt-3.5-turbo",
|
12 |
+
messages=messages
|
13 |
)
|
14 |
ChatGPT_reply = response["choices"][0]["message"]["content"]
|
15 |
messages.append({"role": "assistant", "content": ChatGPT_reply})
|
|
|
18 |
demo = gr.Interface(
|
19 |
fn=CustomChatGPT,
|
20 |
inputs=gr.inputs.Text(label="Ask a question"), # Add a label to the input component
|
21 |
+
outputs="text",
|
22 |
title="Web(GPT)3 Daily"
|
23 |
)
|
24 |
|