Namitg02 commited on
Commit
295dec0
·
verified ·
1 Parent(s): 7a38f19

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -147,9 +147,9 @@ def talk(prompt, history):
147
  stream = model.create_chat_completion(messages = [{"role":"system","content":SYS_PROMPT},{"role":"user","content":formatted_prompt}], max_tokens=1000, stop=["</s>"], stream=True)
148
  # print(output['choices'][0]['message']['content'])
149
  pprint.pprint(stream)
150
- # for output in stream:
151
- # text += output["choices"][0]["text"]
152
- # yield text
153
 
154
  # preparing tokens for model input
155
  # add_generation_prompt argument tells the template to add tokens that indicate the start of a bot response
 
147
  stream = model.create_chat_completion(messages = [{"role":"system","content":SYS_PROMPT},{"role":"user","content":formatted_prompt}], max_tokens=1000, stop=["</s>"], stream=True)
148
  # print(output['choices'][0]['message']['content'])
149
  pprint.pprint(stream)
150
+ for output in stream:
151
+ text += output["choices"][0]["text"]
152
+ yield text
153
 
154
  # preparing tokens for model input
155
  # add_generation_prompt argument tells the template to add tokens that indicate the start of a bot response