dkdaniz commited on
Commit
32562a3
1 Parent(s): 0770449

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +3 -3
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), 200
93
  else:
94
- return "No user prompt received", 400
 
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")