leolaish commited on
Commit
ada877f
·
verified ·
1 Parent(s): 3214855

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -554,14 +554,14 @@ def generate(message, temperature):
554
  stream = client.chat.completions.create(
555
  model="H4/zephyr-7b-beta",
556
  messages=message,
557
- stream=False,
558
  max_tokens=1024,
559
  stop=["output\n"],
560
  temperature=temperature,
561
  #timeout=30,
562
  )
563
 
564
- response = stream.output
565
 
566
  # The reason why the library method is not used here is that if an error occurs,
567
  # the returned data will not be a stream, and using the official library will result in an error.
 
554
  stream = client.chat.completions.create(
555
  model="H4/zephyr-7b-beta",
556
  messages=message,
557
+ stream=True,
558
  max_tokens=1024,
559
  stop=["output\n"],
560
  temperature=temperature,
561
  #timeout=30,
562
  )
563
 
564
+ response = stream.text
565
 
566
  # The reason why the library method is not used here is that if an error occurs,
567
  # the returned data will not be a stream, and using the official library will result in an error.