Spaces:
Running
Running
Update main.py
Browse files
main.py
CHANGED
@@ -193,9 +193,11 @@ async def get_completion(payload: Payload,request: Request):
|
|
193 |
|
194 |
except requests.exceptions.RequestException as req_err:
|
195 |
# Handle request-specific errors
|
|
|
196 |
raise HTTPException(status_code=500, detail=f"Request failed: {req_err}")
|
197 |
except Exception as e:
|
198 |
# Handle unexpected errors
|
|
|
199 |
raise HTTPException(status_code=500, detail=f"An unexpected error occurred: {e}")
|
200 |
|
201 |
return StreamingResponse(stream_generator(payload_dict), media_type="application/json")
|
|
|
193 |
|
194 |
except requests.exceptions.RequestException as req_err:
|
195 |
# Handle request-specific errors
|
196 |
+
print(response.text)
|
197 |
raise HTTPException(status_code=500, detail=f"Request failed: {req_err}")
|
198 |
except Exception as e:
|
199 |
# Handle unexpected errors
|
200 |
+
print(response.text)
|
201 |
raise HTTPException(status_code=500, detail=f"An unexpected error occurred: {e}")
|
202 |
|
203 |
return StreamingResponse(stream_generator(payload_dict), media_type="application/json")
|