Spaces:
Runtime error
Runtime error
Update app.py
Browse files39 unmodified lines4041424344454656 unmodified lines10310410510610710810911010 unmodified lines12112212312412512612716 unmodified lines14414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617739 unmodified linespages = loader.load_and_split()text = ""for page in pages:print(page.page_content)text = text + " "+page.page_content+ "\n\n"return textdef generate_pdf_from_markup(markup_text):56 unmodified linesst.write(formatted_data)pdf_path = ""if st.button("Generate PDF"):# Add spinner while generating the PDFwith st.spinner("Generating PDF..."):# Generate the PDF from markup text10 unmodified linesfile_name="generated.pdf",mime="application/pdf")def main():st.title("Resume Parser")option = st.radio(16 unmodified linesst.success(f"File saved at {original_file_path}")handle_pdf(original_file_path)# with st.spinner("Parsing Resume..."):# data = read_pdf(original_file_path)# modified_data = parse_resume(data)# formatted_data = format_string(modified_data["text"])# st.write(formatted_data)# pdf_path = ""# if st.button("Generate PDF"):# # Add spinner while generating the PDF# with st.spinner("Generating PDF..."):# # Generate the PDF from markup text# pdf_path = generate_pdf_from_markup(formatted_data)# st.success("PDF generated successfully.")# # Show the preview of the first page of the PDF# with open(pdf_path, "rb") as f:# pdf_bytes = f.read()# st.download_button(# label="Download PDF",# data=pdf_bytes,# file_name="generated.pdf",# mime="application/pdf"# )if __name__ == "__main__":main()39 unmodified lines40414243444556 unmodified lines10210310410510610710810911011111211310 unmodified lines12412512612712812913016 unmodified lines14714814915015115215339 unmodified linespages = loader.load_and_split()text = ""for page in pages:text = text + " "+page.page_content+ "\n\n"return textdef generate_pdf_from_markup(markup_text):56 unmodified linesst.write(formatted_data)pdf_path = ""print("Formatted text generated")print(formatted_data)if formatted_data:# if st.button("Generate PDF"):print("Button Clicked")# Add spinner while generating the PDFwith st.spinner("Generating PDF..."):# Generate the PDF from markup text10 unmodified linesfile_name="generated.pdf",mime="application/pdf")print("AT LAST")def main():st.title("Resume Parser")option = st.radio(16 unmodified linesst.success(f"File saved at {original_file_path}")handle_pdf(original_file_path)if __name__ == "__main__":main()
app.py+8-32