Update app.py
Browse files
app.py
CHANGED
|
@@ -7,6 +7,7 @@ messages = [{"role": "system", "content": "You are a Web3 and cryptocurrency exp
|
|
| 7 |
|
| 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
|
|
@@ -15,16 +16,11 @@ def CustomChatGPT(user_input):
|
|
| 15 |
messages.append({"role": "assistant", "content": ChatGPT_reply})
|
| 16 |
return ChatGPT_reply
|
| 17 |
|
| 18 |
-
def CustomChatGPT(input_text):
|
| 19 |
-
# Your function implementation
|
| 20 |
-
pass
|
| 21 |
-
|
| 22 |
-
# Create the interface with a labeled input component
|
| 23 |
demo = gr.Interface(
|
| 24 |
fn=CustomChatGPT,
|
| 25 |
-
inputs=
|
| 26 |
-
outputs="text",
|
| 27 |
-
title="Web(GPT)3 Daily"
|
| 28 |
)
|
| 29 |
|
| 30 |
demo.launch()
|
|
|
|
| 7 |
|
| 8 |
def CustomChatGPT(user_input):
|
| 9 |
messages.append({"role": "user", "content": user_input})
|
| 10 |
+
inputs=gr.inputs.Text(label="Ask a question"),
|
| 11 |
response = openai.ChatCompletion.create(
|
| 12 |
model = "gpt-3.5-turbo",
|
| 13 |
messages = messages
|
|
|
|
| 16 |
messages.append({"role": "assistant", "content": ChatGPT_reply})
|
| 17 |
return ChatGPT_reply
|
| 18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
demo = gr.Interface(
|
| 20 |
fn=CustomChatGPT,
|
| 21 |
+
inputs = "text"
|
| 22 |
+
outputs = "text",
|
| 23 |
+
title = "Web(GPT)3 Daily"
|
| 24 |
)
|
| 25 |
|
| 26 |
demo.launch()
|