Update app.py
Browse files
app.py
CHANGED
@@ -551,7 +551,7 @@ def generate(message, temperature):
|
|
551 |
If no error occurred, the boolean flag will be False and the content will be the response text.
|
552 |
If an error occurred, the boolean flag will be True and the content will be the error message.
|
553 |
"""
|
554 |
-
|
555 |
model="H4/zephyr-7b-beta",
|
556 |
messages=message,
|
557 |
stream=True,
|
@@ -561,7 +561,7 @@ def generate(message, 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.
|
|
|
551 |
If no error occurred, the boolean flag will be False and the content will be the response text.
|
552 |
If an error occurred, the boolean flag will be True and the content will be the error message.
|
553 |
"""
|
554 |
+
response = client.chat.completions.create(
|
555 |
model="H4/zephyr-7b-beta",
|
556 |
messages=message,
|
557 |
stream=True,
|
|
|
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.
|