richardkimsm89 commited on
Commit
d7c4ce9
·
verified ·
1 Parent(s): 2619751

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -3
app.py CHANGED
@@ -37,10 +37,15 @@ def fn(
37
  stream = True
38
  )
39
 
40
- response = ""
 
 
 
 
 
41
  for chunk in stream:
42
- response += chunk.choices[0].delta.content
43
- return response
44
 
45
  app = gr.ChatInterface(
46
  fn = fn,
 
37
  stream = True
38
  )
39
 
40
+ #response = ""
41
+ #for chunk in stream:
42
+ # response += chunk.choices[0].delta.content
43
+ #return response
44
+
45
+ chunks = []
46
  for chunk in stream:
47
+ chunks.append(chunk.choices[0].delta.content or "")
48
+ yield "".join(chunks)
49
 
50
  app = gr.ChatInterface(
51
  fn = fn,