Spaces:
Sleeping
Sleeping
added resume download
Browse files- resume_screener.py +17 -7
resume_screener.py
CHANGED
|
@@ -6,7 +6,9 @@ from uuid import uuid4
|
|
| 6 |
load_dotenv()
|
| 7 |
|
| 8 |
def ResumeScreener():
|
| 9 |
-
|
|
|
|
|
|
|
| 10 |
class EmptyText(Exception):
|
| 11 |
"""
|
| 12 |
A custom exception for when an input component
|
|
@@ -104,20 +106,28 @@ def ResumeScreener():
|
|
| 104 |
</style>
|
| 105 |
""", unsafe_allow_html=True)
|
| 106 |
with st.container(
|
| 107 |
-
height=
|
| 108 |
border=False
|
| 109 |
):
|
| 110 |
|
| 111 |
-
# The LLM chain for summarization
|
| 112 |
-
if 'SUMMARIZATION_CHAIN' not in st.session_state:
|
| 113 |
-
st.session_state.SUMMARIZATION_CHAIN = summarize_chain()
|
| 114 |
-
|
| 115 |
# The results component
|
| 116 |
match_resumes(
|
| 117 |
job_description=txt,
|
| 118 |
k=docs_num,
|
| 119 |
vector_store=vector_store,
|
| 120 |
-
summarization_chain=
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 121 |
)
|
| 122 |
|
| 123 |
st.session_state.DISPLAY_RESULTS = False
|
|
|
|
| 6 |
load_dotenv()
|
| 7 |
|
| 8 |
def ResumeScreener():
|
| 9 |
+
|
| 10 |
+
st.session_state.CURRENT_PAGE = st.session_state.RESUME_SCREENER_PAGE
|
| 11 |
+
|
| 12 |
class EmptyText(Exception):
|
| 13 |
"""
|
| 14 |
A custom exception for when an input component
|
|
|
|
| 106 |
</style>
|
| 107 |
""", unsafe_allow_html=True)
|
| 108 |
with st.container(
|
| 109 |
+
height=700,
|
| 110 |
border=False
|
| 111 |
):
|
| 112 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 113 |
# The results component
|
| 114 |
match_resumes(
|
| 115 |
job_description=txt,
|
| 116 |
k=docs_num,
|
| 117 |
vector_store=vector_store,
|
| 118 |
+
summarization_chain=summarize_chain()
|
| 119 |
+
)
|
| 120 |
+
|
| 121 |
+
# Download all as ZIP
|
| 122 |
+
if st.session_state.VECTOR_SCORE:
|
| 123 |
+
files = pdfs_dict(st.session_state.VECTOR_SCORE)
|
| 124 |
+
zip_buffer = create_zip_with_pdfs(files, create_pdf)
|
| 125 |
+
|
| 126 |
+
st.download_button(
|
| 127 |
+
label="Download all as ZIP",
|
| 128 |
+
data=zip_buffer,
|
| 129 |
+
file_name=f"resumes-{uuid4()}.zip",
|
| 130 |
+
mime="application/zip"
|
| 131 |
)
|
| 132 |
|
| 133 |
st.session_state.DISPLAY_RESULTS = False
|