Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -107,12 +107,15 @@ def respond(
|
|
107 |
temperature=temperature,
|
108 |
top_p=top_p,
|
109 |
):
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
|
|
|
|
|
|
116 |
|
117 |
"""
|
118 |
For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
|
|
|
107 |
temperature=temperature,
|
108 |
top_p=top_p,
|
109 |
):
|
110 |
+
try:
|
111 |
+
print(message.choices)
|
112 |
+
token = message.choices[0].delta.content
|
113 |
+
response += token
|
114 |
+
print(response)
|
115 |
+
translated_response = translator.translate(response, src='en', dest=message_language).text
|
116 |
+
yield translated_response
|
117 |
+
except:
|
118 |
+
yield ""
|
119 |
|
120 |
"""
|
121 |
For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
|