nhathuy07 commited on
Commit
425e817
·
verified ·
1 Parent(s): 2b5f6e8

add error logging code

Browse files
Files changed (1) hide show
  1. main.py +3 -2
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(