Ammar-Abdelhady-ai commited on
Commit
e00720e
1 Parent(s): c6f585d

Add large files and enable Git LF

Browse files
Files changed (1) hide show
  1. main.py +5 -18
main.py CHANGED
@@ -66,31 +66,18 @@ async def read_root():
66
  return {"Hello": "World, Project name is : CV Description"}
67
 
68
 
69
- from fastapi import UploadFile, Form, HTTPException
70
- from pydantic import BaseModel
71
-
72
- class CVUpload(BaseModel):
73
- cv: UploadFile
74
-
75
  @app.post("/prediction")
76
- async def detect(cv_data: CVUpload, number_of_jobs: int):
 
77
  if (type(number_of_jobs) != int) or (number_of_jobs < 1) or (number_of_jobs > df.shape[0]):
78
  raise HTTPException(
79
- status_code=415, detail=f"Please enter the number of jobs as an integer from 1 to {int(df.shape[0]) - 1}."
80
  )
81
 
82
- if cv_data.cv.filename.split(".")[-1] not in ("pdf"):
83
  raise HTTPException(
84
- status_code=415, detail="Please upload a PDF file."
85
  )
86
-
87
- cv = cv_data.cv
88
- # The rest of your code...
89
-
90
- # The rest of your code...
91
-
92
-
93
-
94
 
95
  cv_data = extract_text_from_pdf(await cv.read())
96
  index = len(cv_data)//3
 
66
  return {"Hello": "World, Project name is : CV Description"}
67
 
68
 
 
 
 
 
 
 
69
  @app.post("/prediction")
70
+ async def detect(cv: UploadFile, number_of_jobs: int):
71
+
72
  if (type(number_of_jobs) != int) or (number_of_jobs < 1) or (number_of_jobs > df.shape[0]):
73
  raise HTTPException(
74
+ status_code=415, detail = f"Please enter the number of jobs you want as an ' integer from 1 to {int(df.shape[0]) - 1} '."
75
  )
76
 
77
+ if cv.filename.split(".")[-1] not in ("pdf") :
78
  raise HTTPException(
79
+ status_code=415, detail="Please inter PDF file "
80
  )
 
 
 
 
 
 
 
 
81
 
82
  cv_data = extract_text_from_pdf(await cv.read())
83
  index = len(cv_data)//3