Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -50,11 +50,7 @@ def generate_answer(message: str, history: list) -> str:
|
|
| 50 |
stream=True
|
| 51 |
)
|
| 52 |
|
| 53 |
-
|
| 54 |
-
for chunk in stream:
|
| 55 |
-
token = chunk['choices'][0]['text']
|
| 56 |
-
partial_response += token
|
| 57 |
-
yield partial_response
|
| 58 |
|
| 59 |
# Build the Gradio Chat Interface
|
| 60 |
demo = gr.ChatInterface(
|
|
|
|
| 50 |
stream=True
|
| 51 |
)
|
| 52 |
|
| 53 |
+
return stream['choices'][0]['text'].strip()
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
|
| 55 |
# Build the Gradio Chat Interface
|
| 56 |
demo = gr.ChatInterface(
|