Spaces:
Build error
Build error
removed printing of llm sherpa json
Browse files
app.py
CHANGED
|
@@ -117,12 +117,11 @@ def extract(output):
|
|
| 117 |
return {}
|
| 118 |
|
| 119 |
def process_resume(pdf_content):
|
| 120 |
-
response = requests.post(llmsherpa_api_url, files={'file': ('
|
| 121 |
|
| 122 |
# Check if the response is valid JSON
|
| 123 |
try:
|
| 124 |
response_json = response.json()
|
| 125 |
-
print(response_json)
|
| 126 |
except json.JSONDecodeError:
|
| 127 |
print("Failed to decode JSON response")
|
| 128 |
return None
|
|
@@ -381,7 +380,7 @@ def main():
|
|
| 381 |
failed_resumes_count += 1
|
| 382 |
|
| 383 |
if successful_resumes:
|
| 384 |
-
|
| 385 |
|
| 386 |
if failed_resumes_count > 0:
|
| 387 |
st.warning(f"{failed_resumes_count} resumes could not be processed. Do you still want to download the successfully processed resumes?")
|
|
@@ -424,8 +423,10 @@ def main():
|
|
| 424 |
mime="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
| 425 |
)
|
| 426 |
|
| 427 |
-
|
| 428 |
|
|
|
|
|
|
|
| 429 |
else:
|
| 430 |
st.error("Aw! Snap, could not process any of the resumes. Please try again later.")
|
| 431 |
|
|
|
|
| 117 |
return {}
|
| 118 |
|
| 119 |
def process_resume(pdf_content):
|
| 120 |
+
response = requests.post(llmsherpa_api_url, files={'file': ('resume.pdf', pdf_content, 'application/pdf')})
|
| 121 |
|
| 122 |
# Check if the response is valid JSON
|
| 123 |
try:
|
| 124 |
response_json = response.json()
|
|
|
|
| 125 |
except json.JSONDecodeError:
|
| 126 |
print("Failed to decode JSON response")
|
| 127 |
return None
|
|
|
|
| 380 |
failed_resumes_count += 1
|
| 381 |
|
| 382 |
if successful_resumes:
|
| 383 |
+
|
| 384 |
|
| 385 |
if failed_resumes_count > 0:
|
| 386 |
st.warning(f"{failed_resumes_count} resumes could not be processed. Do you still want to download the successfully processed resumes?")
|
|
|
|
| 423 |
mime="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
| 424 |
)
|
| 425 |
|
| 426 |
+
st.success(f"Resumes processed successfully! {len(successful_resumes)} out of {max_resumes} resumes processed.")
|
| 427 |
|
| 428 |
+
|
| 429 |
+
|
| 430 |
else:
|
| 431 |
st.error("Aw! Snap, could not process any of the resumes. Please try again later.")
|
| 432 |
|