Spaces:
Sleeping
Sleeping
Commit
·
b72536d
1
Parent(s):
8f9c586
update
Browse files- requirements.txt +0 -1
- src/streamlit_app.py +30 -29
requirements.txt
CHANGED
|
@@ -2,7 +2,6 @@ streamlit
|
|
| 2 |
litellm
|
| 3 |
pydantic
|
| 4 |
pyyaml
|
| 5 |
-
weasyprint
|
| 6 |
python-dotenv
|
| 7 |
pytest
|
| 8 |
tenacity
|
|
|
|
| 2 |
litellm
|
| 3 |
pydantic
|
| 4 |
pyyaml
|
|
|
|
| 5 |
python-dotenv
|
| 6 |
pytest
|
| 7 |
tenacity
|
src/streamlit_app.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
import os
|
| 3 |
import datetime
|
| 4 |
-
from services import analyse_service, generation_service
|
| 5 |
|
| 6 |
def initialize_session_state():
|
| 7 |
"""Initializes session state variables."""
|
|
@@ -78,34 +78,35 @@ def main():
|
|
| 78 |
if st.button("Refine", use_container_width=True):
|
| 79 |
handle_refine(feedback_input)
|
| 80 |
|
| 81 |
-
st.header("Export")
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
if
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
|
|
|
| 109 |
|
| 110 |
|
| 111 |
# --- Main Area for Outputs ---
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
import os
|
| 3 |
import datetime
|
| 4 |
+
from services import analyse_service, generation_service
|
| 5 |
|
| 6 |
def initialize_session_state():
|
| 7 |
"""Initializes session state variables."""
|
|
|
|
| 78 |
if st.button("Refine", use_container_width=True):
|
| 79 |
handle_refine(feedback_input)
|
| 80 |
|
| 81 |
+
# st.header("Export")
|
| 82 |
+
# PDF export functionality temporarily disabled
|
| 83 |
+
# if st.button("Export to PDF", use_container_width=True):
|
| 84 |
+
# if st.session_state.resume_md and st.session_state.cover_letter_txt:
|
| 85 |
+
# timestamp = datetime.datetime.now().strftime("%Y%m%d_%H%M%S")
|
| 86 |
+
# resume_path = os.path.join("exports", f"{timestamp}_resume.pdf")
|
| 87 |
+
# cover_letter_path = os.path.join("exports", f"{timestamp}_cover_letter.pdf")
|
| 88 |
+
|
| 89 |
+
# with st.spinner("Generating PDFs..."):
|
| 90 |
+
# try:
|
| 91 |
+
# pdf_service.md_to_pdf(st.session_state.resume_md, resume_path)
|
| 92 |
+
# st.session_state.resume_pdf_path = resume_path
|
| 93 |
+
|
| 94 |
+
# pdf_service.txt_to_pdf(st.session_state.cover_letter_txt, cover_letter_path)
|
| 95 |
+
# st.session_state.cover_letter_pdf_path = cover_letter_path
|
| 96 |
+
# st.success("PDFs generated successfully!")
|
| 97 |
+
# except Exception as e:
|
| 98 |
+
# st.error(f"Failed to generate PDFs: {e}")
|
| 99 |
+
# else:
|
| 100 |
+
# st.warning("Please generate documents before exporting.")
|
| 101 |
+
|
| 102 |
+
# # Display download buttons if PDFs have been created
|
| 103 |
+
# if 'resume_pdf_path' in st.session_state and os.path.exists(st.session_state.resume_pdf_path):
|
| 104 |
+
# with open(st.session_state.resume_pdf_path, "rb") as f:
|
| 105 |
+
# st.download_button("Download Resume PDF", f, file_name=os.path.basename(st.session_state.resume_pdf_path), use_container_width=True)
|
| 106 |
+
|
| 107 |
+
# if 'cover_letter_pdf_path' in st.session_state and os.path.exists(st.session_state.cover_letter_pdf_path):
|
| 108 |
+
# with open(st.session_state.cover_letter_pdf_path, "rb") as f:
|
| 109 |
+
# st.download_button("Download Cover Letter PDF", f, file_name=os.path.basename(st.session_state.cover_letter_pdf_path), use_container_width=True)
|
| 110 |
|
| 111 |
|
| 112 |
# --- Main Area for Outputs ---
|