ankush13r commited on
Commit
07949e1
·
verified ·
1 Parent(s): 1186dff

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -11
app.py CHANGED
@@ -129,18 +129,20 @@ def respond(
129
  result = ""
130
  appended = False
131
  for chunk in completion:
132
- result += chunk.choices[0].delta.content
133
- if not appended:
134
- history.append(
135
- ChatMessage(
136
- role="assistant",
137
- content="",
 
 
 
138
  )
139
- )
140
- appended = True
141
-
142
- history[-1].content = result
143
- yield history[-2:]
144
 
145
  """
146
  For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
 
129
  result = ""
130
  appended = False
131
  for chunk in completion:
132
+ print(chunk)
133
+ if chunk.choices[0].delta.content:
134
+ result += chunk.choices[0].delta.content
135
+ if not appended:
136
+ history.append(
137
+ ChatMessage(
138
+ role="assistant",
139
+ content="",
140
+ )
141
  )
142
+ appended = True
143
+
144
+ history[-1].content = result
145
+ yield history[-2:]
 
146
 
147
  """
148
  For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface