Spaces:
Running
Running
Update main.py
Browse files
main.py
CHANGED
@@ -35,15 +35,19 @@ def input_pdf_text(uploaded_file):
|
|
35 |
return text
|
36 |
|
37 |
|
|
|
|
|
|
|
|
|
38 |
@app.post("/resume_parser/")
|
39 |
-
|
40 |
contents = await file.read()
|
41 |
with open(file.filename, 'wb') as f:
|
42 |
f.write(contents)
|
43 |
|
44 |
-
return
|
45 |
|
46 |
-
|
47 |
|
48 |
text=input_pdf_text(pdf_source)
|
49 |
response=get_gemini_repsonse(input_prompt)
|
|
|
35 |
return text
|
36 |
|
37 |
|
38 |
+
@app.get("/")
|
39 |
+
async def root():
|
40 |
+
return {"Text Emotion Classification":"Version 1.5 'Text'"}
|
41 |
+
|
42 |
@app.post("/resume_parser/")
|
43 |
+
def process_pdf_file(file: UploadFile = File(...)):
|
44 |
contents = await file.read()
|
45 |
with open(file.filename, 'wb') as f:
|
46 |
f.write(contents)
|
47 |
|
48 |
+
return process_pdf(file.filename)
|
49 |
|
50 |
+
def process_pdf(pdf_source):
|
51 |
|
52 |
text=input_pdf_text(pdf_source)
|
53 |
response=get_gemini_repsonse(input_prompt)
|