Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,3 @@
|
|
1 |
-
import random
|
2 |
import gradio as gr
|
3 |
from gradio_client import Client
|
4 |
|
@@ -15,8 +14,11 @@ def random_response(message, history):
|
|
15 |
api_name="/chat"
|
16 |
)
|
17 |
|
|
|
|
|
|
|
18 |
# Return the response and updated history as a dictionary
|
19 |
-
return
|
20 |
|
21 |
# Set up Gradio chat interface
|
22 |
demo = gr.ChatInterface(
|
|
|
|
|
1 |
import gradio as gr
|
2 |
from gradio_client import Client
|
3 |
|
|
|
14 |
api_name="/chat"
|
15 |
)
|
16 |
|
17 |
+
# Format response as a dictionary
|
18 |
+
response = {"text": result}
|
19 |
+
|
20 |
# Return the response and updated history as a dictionary
|
21 |
+
return response, history + [(message, response)] # Append the current message and response to history
|
22 |
|
23 |
# Set up Gradio chat interface
|
24 |
demo = gr.ChatInterface(
|