chansung commited on
Commit
7c54130
1 Parent(s): 1f4fa87

Update app/main.py

Browse files
Files changed (1) hide show
  1. app/main.py +4 -3
app/main.py CHANGED
@@ -43,9 +43,10 @@ async def echo(message, history):
43
 
44
  history.append([message, ""])
45
  full_resp = ""
46
- async for resp in client.chat.completions.create(
47
- model="tgi", messages=messages, **parameters
48
- ):
 
49
  full_resp = full_resp + resp.choices[0].delta.content
50
  history[-1][1] = full_resp
51
  yield history
 
43
 
44
  history.append([message, ""])
45
  full_resp = ""
46
+
47
+ responses = client.chat.completions.create(model="tgi", messages=messages, **parameters)
48
+
49
+ async for resp in responses:
50
  full_resp = full_resp + resp.choices[0].delta.content
51
  history[-1][1] = full_resp
52
  yield history