Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -418,7 +418,17 @@ if uploaded_resume and uploaded_job_description:
|
|
418 |
if generated_resume is not None:
|
419 |
|
420 |
from io import BytesIO
|
421 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
422 |
with tempfile.NamedTemporaryFile(suffix='.docx') as temp_doc:
|
423 |
doc = Document()
|
424 |
doc.add_paragraph(generated_resume)
|
|
|
418 |
if generated_resume is not None:
|
419 |
|
420 |
from io import BytesIO
|
421 |
+
with tempfile.NamedTemporaryFile(delete=False, suffix=".docx") as temp_doc:
|
422 |
+
temp_doc_path = temp_doc.name
|
423 |
+
doc.save(temp_doc_path)
|
424 |
+
|
425 |
+
# Now pass the path to any function that expects a file path
|
426 |
+
pdf_path = '/tmp/generated_resume.pdf'
|
427 |
+
save_docx_as_pdf(temp_doc_path, pdf_path)
|
428 |
+
|
429 |
+
# Display the generated PDF or handle further processing
|
430 |
+
display_doc_as_image(pdf_output_path)
|
431 |
+
|
432 |
with tempfile.NamedTemporaryFile(suffix='.docx') as temp_doc:
|
433 |
doc = Document()
|
434 |
doc.add_paragraph(generated_resume)
|