Oleg Lavrovsky commited on
Commit
3edc85c
·
unverified ·
1 Parent(s): 9857cc7

Log exceptions

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -154,7 +154,7 @@ async def completion(data: Completion):
154
  raise HTTPException(status_code=503, detail="Model not loaded")
155
 
156
  try:
157
- mt = data.messages_think
158
  text = get_completion_text(mt)
159
  result = get_model_reponse(mt)
160
 
@@ -174,6 +174,7 @@ async def completion(data: Completion):
174
  }
175
  }
176
  except Exception as e:
 
177
  raise HTTPException(status_code=400, detail="Could not process") from e
178
 
179
 
@@ -206,7 +207,7 @@ async def predict(q: str):
206
  )
207
 
208
  except Exception as e:
209
- logger.error(f"Evaluation error: {e}")
210
  raise HTTPException(status_code=500, detail="Evaluation failed")
211
 
212
  @app.get("/health")
 
154
  raise HTTPException(status_code=503, detail="Model not loaded")
155
 
156
  try:
157
+ mt = data.messages
158
  text = get_completion_text(mt)
159
  result = get_model_reponse(mt)
160
 
 
174
  }
175
  }
176
  except Exception as e:
177
+ logger.warning(e)
178
  raise HTTPException(status_code=400, detail="Could not process") from e
179
 
180
 
 
207
  )
208
 
209
  except Exception as e:
210
+ logger.warning(e)
211
  raise HTTPException(status_code=500, detail="Evaluation failed")
212
 
213
  @app.get("/health")