Spaces:
Runtime error
Runtime error
Oleg Lavrovsky
commited on
Log exceptions
Browse files
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.
|
| 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.
|
| 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")
|