IamLevin40 commited on
Commit
ddd47f2
·
verified ·
1 Parent(s): 12ffc5a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -5
app.py CHANGED
@@ -50,11 +50,7 @@ def generate_answer(message: str, history: list) -> str:
50
  stream=True
51
  )
52
 
53
- partial_response = ""
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(