Spaces:
Running
Running
add error logging code
Browse files
main.py
CHANGED
@@ -201,8 +201,9 @@ async def __query_ml_predict(qtype: QType, content: str, header: str, token_limi
|
|
201 |
}),
|
202 |
timeout=None
|
203 |
)
|
204 |
-
|
205 |
print(time() - stopwatch)
|
|
|
206 |
return {"content": _r.json()['choices'][0]['message']['content'], "style": QType.WH}
|
207 |
|
208 |
case QType.STMT:
|
@@ -222,7 +223,7 @@ async def __query_ml_predict(qtype: QType, content: str, header: str, token_limi
|
|
222 |
}),
|
223 |
timeout=None
|
224 |
)
|
225 |
-
|
226 |
_r_content = _r.json()['choices'][0]['message']['content'].split('\n\n',1)[1]
|
227 |
async with httpx.AsyncClient() as client:
|
228 |
_w = await client.post(
|
|
|
201 |
}),
|
202 |
timeout=None
|
203 |
)
|
204 |
+
|
205 |
print(time() - stopwatch)
|
206 |
+
if _r.status_code != 200: app_logger.info(_r.json())
|
207 |
return {"content": _r.json()['choices'][0]['message']['content'], "style": QType.WH}
|
208 |
|
209 |
case QType.STMT:
|
|
|
223 |
}),
|
224 |
timeout=None
|
225 |
)
|
226 |
+
if _r.status_code != 200: app_logger.info(_r.json())
|
227 |
_r_content = _r.json()['choices'][0]['message']['content'].split('\n\n',1)[1]
|
228 |
async with httpx.AsyncClient() as client:
|
229 |
_w = await client.post(
|