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