Ammar-Abdelhady-ai commited on
Commit
accfc4d
·
1 Parent(s): f254531

Add application file

Browse files
Files changed (1) hide show
  1. main.py +5 -4
main.py CHANGED
@@ -65,15 +65,16 @@ async def read_root():
65
  return {"Hello": "World, Project name is : CV Description"}
66
 
67
  @app.post("/prediction")
68
- async def detect(cv: UploadFile = File(...), number_of_jobs: int = Form(...)):
 
69
  if (type(number_of_jobs) != int) or (number_of_jobs < 1) or (number_of_jobs > df.shape[0]):
70
  raise HTTPException(
71
- status_code=415, detail=f"Please enter the number of jobs as an integer from 1 to {int(df.shape[0]) - 1}."
72
  )
73
 
74
- if cv.filename.split(".")[-1] not in ("pdf"):
75
  raise HTTPException(
76
- status_code=415, detail="Please upload a PDF file."
77
  )
78
 
79
 
 
65
  return {"Hello": "World, Project name is : CV Description"}
66
 
67
  @app.post("/prediction")
68
+ async def detect(cv: UploadFile, number_of_jobs: int):
69
+
70
  if (type(number_of_jobs) != int) or (number_of_jobs < 1) or (number_of_jobs > df.shape[0]):
71
  raise HTTPException(
72
+ status_code=415, detail = f"Please enter the number of jobs you want as an ' integer from 1 to {int(df.shape[0]) - 1} '."
73
  )
74
 
75
+ if cv.filename.split(".")[-1] not in ("pdf") :
76
  raise HTTPException(
77
+ status_code=415, detail="Please inter PDF file "
78
  )
79
 
80