Quardo commited on
Commit
72f13c3
1 Parent(s): d566f90

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -1
app.py CHANGED
@@ -200,7 +200,15 @@ async def respond(
200
  return
201
 
202
  response = ""
203
- async for token in completion:
 
 
 
 
 
 
 
 
204
  response += token['choices'][0]['delta'].get("content", token['choices'][0]['delta'].get("refusal", ""))
205
  yield f"{prefix}{response}"
206
 
 
200
  return
201
 
202
  response = ""
203
+ async for token in streamChat({
204
+ "model": model_name,
205
+ "messages": messages,
206
+ "max_tokens": max_tokens,
207
+ "temperature": temperature,
208
+ "top_p": top_p,
209
+ "user": rnd(),
210
+ "stream": True
211
+ }):
212
  response += token['choices'][0]['delta'].get("content", token['choices'][0]['delta'].get("refusal", ""))
213
  yield f"{prefix}{response}"
214