Update app.py
Browse files
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=
|
| 558 |
max_tokens=1024,
|
| 559 |
stop=["output\n"],
|
| 560 |
temperature=temperature,
|
| 561 |
#timeout=30,
|
| 562 |
)
|
| 563 |
|
| 564 |
-
response = stream.
|
| 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.
|