Vaibhav84 commited on
Commit
55d1a9e
·
1 Parent(s): c121c86
Files changed (1) hide show
  1. app.py +8 -12
app.py CHANGED
@@ -98,24 +98,20 @@ def ExtractSkills(skill_data: SkillDetails):
98
 
99
  @app.post("/uploadJobDescription/")
100
  def create_upload_file(file: bytes = File(...)):
101
- content = file.decode('utf-8')
102
  lines = content.split('\n')
103
  return {"content": lines}
104
 
105
  @app.post("/uploadJobDescriptionPDF/")
106
  def upload_PDF(file: UploadFile = File(...)):
107
- text=''
108
- try:
109
- load_pdf = PyPDF2.PdfReader(file)
110
- for page in load_pdf.pages:
111
- text += page.extract_text()
112
- print(text)
113
- except Exception:
114
- return {"message": "There was an error uploading the file"}
115
- finally:
116
- file.file.close()
117
 
118
- return {"message": f"Successfully uploaded {text}"}
119
 
120
  @app.post("/uploadJobDescriptionPDF2/")
121
  def process_pdf_file(file: bytes = File(...)):
 
98
 
99
  @app.post("/uploadJobDescription/")
100
  def create_upload_file(file: bytes = File(...)):
101
+ content = file.encode('utf-8').strip()
102
  lines = content.split('\n')
103
  return {"content": lines}
104
 
105
  @app.post("/uploadJobDescriptionPDF/")
106
  def upload_PDF(file: UploadFile = File(...)):
107
+ text=''
108
+ data = json.loads(file.file.read())
109
+
110
+
111
+
112
+
 
 
 
 
113
 
114
+ return {"message": f"Successfully uploaded {data}"}
115
 
116
  @app.post("/uploadJobDescriptionPDF2/")
117
  def process_pdf_file(file: bytes = File(...)):