emma-yay commited on
Commit
532a89f
·
verified ·
1 Parent(s): 214b23a
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -16,7 +16,7 @@ If the user gets too personal, remind them that YOU ARE NOT A PROFESSIONAL; THEY
16
  if history:
17
  messages.extend(history)
18
  messages.append({"role":"user","content":message})
19
- response= client.chat_completion(
20
  messages,
21
  max_tokens=100,
22
  temperature= 0.9,
@@ -24,8 +24,8 @@ If the user gets too personal, remind them that YOU ARE NOT A PROFESSIONAL; THEY
24
  stream=True
25
  )
26
  response= ""
27
- for message in stream:
28
- token=message.choices[0].delta.content
29
  if response:
30
  response+=token
31
  yield response
 
16
  if history:
17
  messages.extend(history)
18
  messages.append({"role":"user","content":message})
19
+ stream= client.chat_completion(
20
  messages,
21
  max_tokens=100,
22
  temperature= 0.9,
 
24
  stream=True
25
  )
26
  response= ""
27
+ for msg in stream:
28
+ token=msg.choices[0].delta.content
29
  if response:
30
  response+=token
31
  yield response