Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -134,8 +134,12 @@ def chat_completions():
|
|
| 134 |
logging.info(_cookie[:50])
|
| 135 |
headers = {"Content-Type": "application/json", "Cookie": _cookie}
|
| 136 |
# 默认 stream 模式开启,但针对 AkashGen 模型关闭流式响应
|
| 137 |
-
stream_flag =
|
| 138 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 139 |
akash_response = requests.post(
|
| 140 |
'https://chat.akash.network/api/chat',
|
| 141 |
json=akash_data,
|
|
|
|
| 134 |
logging.info(_cookie[:50])
|
| 135 |
headers = {"Content-Type": "application/json", "Cookie": _cookie}
|
| 136 |
# 默认 stream 模式开启,但针对 AkashGen 模型关闭流式响应
|
| 137 |
+
stream_flag = True
|
| 138 |
+
if model == "AkashGen":
|
| 139 |
+
stream_flag = False
|
| 140 |
+
else:
|
| 141 |
+
stream_flag = data.get('stream',False)
|
| 142 |
+
logging.info("streamflag: %s", stream_flag)
|
| 143 |
akash_response = requests.post(
|
| 144 |
'https://chat.akash.network/api/chat',
|
| 145 |
json=akash_data,
|