pktpaulie commited on
Commit
43fcb2c
·
verified ·
1 Parent(s): bc30ef4

Create document and update download option

Browse files
Files changed (1) hide show
  1. app.py +28 -14
app.py CHANGED
@@ -96,7 +96,7 @@ if uploaded_resume and uploaded_job_description:
96
 
97
  # Similarity Score Section
98
  st.markdown("---")
99
- st.subheader("Check Job Match")
100
 
101
  if st.button("Resume-JD Matching"):
102
  with st.spinner("Computing Match"):
@@ -126,9 +126,16 @@ if uploaded_resume and uploaded_job_description:
126
  ax.axis('equal')
127
  st.pyplot(fig)
128
 
 
 
 
 
 
 
 
129
  # Generate Tailored Resume Section
130
  st.markdown("---")
131
- st.subheader("Tailor Resume")
132
 
133
  if st.button("Tailor Resume"):
134
  with st.spinner("Generating resume..."):
@@ -136,26 +143,33 @@ if uploaded_resume and uploaded_job_description:
136
  st.subheader("Generated Tailored Resume:")
137
  st.write(generated_resume)
138
 
139
- if generated_resume:
140
  from io import BytesIO
 
 
 
 
 
141
  resume_bytes = BytesIO()
142
- generated_resume.save(resume_bytes)
143
  resume_bytes.seek(0)
144
 
145
  st.download_button(
146
- label="Download Resume",
147
- data=resume_bytes,
148
- file_name="tailored_resume.docx",
149
- mime="application/vnd.openxmlformats-officedocument.wordprocessingml.document"
150
  )
151
 
 
 
 
 
 
 
 
 
152
  else:
153
  st.warning("Please upload both the resume and job description files.")
154
 
155
 
156
- #Autoscroll
157
- st.markdown("""
158
- <script>
159
- window.scrollTo(0, document.body.scrollHeight);
160
- </script>
161
- """, unsafe_allow_html=True)
 
96
 
97
  # Similarity Score Section
98
  st.markdown("---")
99
+ # st.subheader("Check Job Match")
100
 
101
  if st.button("Resume-JD Matching"):
102
  with st.spinner("Computing Match"):
 
126
  ax.axis('equal')
127
  st.pyplot(fig)
128
 
129
+ #Autoscroll
130
+ st.markdown("""
131
+ <script>
132
+ window.scrollTo(0, document.body.scrollHeight);
133
+ </script>
134
+ """, unsafe_allow_html=True)
135
+
136
  # Generate Tailored Resume Section
137
  st.markdown("---")
138
+ # st.subheader("Tailor Resume")
139
 
140
  if st.button("Tailor Resume"):
141
  with st.spinner("Generating resume..."):
 
143
  st.subheader("Generated Tailored Resume:")
144
  st.write(generated_resume)
145
 
146
+ if generated_resume is not None:
147
  from io import BytesIO
148
+ from docx import Document
149
+
150
+ doc = Document()
151
+ doc.add_paragraph(generated_resume)
152
+
153
  resume_bytes = BytesIO()
154
+ doc.save(resume_bytes)
155
  resume_bytes.seek(0)
156
 
157
  st.download_button(
158
+ label="Download Resume",
159
+ data=resume_bytes,
160
+ file_name="tailored_resume.docx",
161
+ mime="application/vnd.openxmlformats-officedocument.wordprocessingml.document"
162
  )
163
 
164
+
165
+ #Autoscroll
166
+ st.markdown("""
167
+ <script>
168
+ window.scrollTo(0, document.body.scrollHeight);
169
+ </script>
170
+ """, unsafe_allow_html=True)
171
+
172
  else:
173
  st.warning("Please upload both the resume and job description files.")
174
 
175