Spaces:
Paused
Paused
Update main.py
Browse files
main.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
from fastapi import FastAPI
|
2 |
import pickle
|
3 |
import uvicorn
|
4 |
|
@@ -89,6 +89,6 @@ async def predict(data: Predict):
|
|
89 |
(os.path.basename(str(document.metadata["source"])), str(document.page_content))
|
90 |
)
|
91 |
|
92 |
-
return jsonify(prompt_response_dict)
|
93 |
else:
|
94 |
-
|
|
|
1 |
+
from fastapi import FastAPI, HTTPException
|
2 |
import pickle
|
3 |
import uvicorn
|
4 |
|
|
|
89 |
(os.path.basename(str(document.metadata["source"])), str(document.page_content))
|
90 |
)
|
91 |
|
92 |
+
return jsonify(prompt_response_dict)
|
93 |
else:
|
94 |
+
raise HTTPException(status_code=400, detail="Prompt Incorrect")
|