Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -354,7 +354,7 @@ def view_scores():
|
|
354 |
'Certifications': certifications_str,
|
355 |
'Experience (Years)': resume.experience_years,
|
356 |
'Education': resume.education_level,
|
357 |
-
'Projects': resume.summary
|
358 |
})
|
359 |
|
360 |
df = pd.DataFrame(data)
|
@@ -367,67 +367,55 @@ def view_scores():
|
|
367 |
# Display all resumes
|
368 |
st.subheader("All Resumes")
|
369 |
for index, row in df_display.iterrows():
|
370 |
-
st.
|
371 |
-
|
372 |
-
st.write(f"Skills: {row['Skills']}")
|
373 |
-
st.write(f"Certifications: {row['Certifications']}")
|
374 |
-
st.write(f"Experience: {row['Experience (Years)']} years")
|
375 |
-
st.write(f"Education: {row['Education']}")
|
376 |
-
st.write(f"Projects: {row['Projects']}")
|
377 |
-
|
378 |
-
col1, col2 = st.columns([1, 1])
|
379 |
-
with col1:
|
380 |
-
if st.button(f"View Detailed Analysis ({row['Name']})", key=f"view_{index}"):
|
381 |
-
st.write(f"## Analysis Report for {row['Name']}")
|
382 |
-
st.write(f"### Score: {row['Score']}%")
|
383 |
-
st.write(f"### Skills: {row['Skills']}")
|
384 |
-
st.write(f"### Certifications: {row['Certifications']}")
|
385 |
-
st.write(f"### Experience: {row['Experience (Years)']} years")
|
386 |
-
st.write(f"### Education: {row['Education']}")
|
387 |
-
st.write("### Projects:")
|
388 |
-
st.text(row['Projects'])
|
389 |
-
with col2:
|
390 |
-
if st.button(f"Delete {row['Name']}", key=f"delete_{index}"):
|
391 |
-
# Find the resume in the database and delete it
|
392 |
-
resume_to_delete = session.query(ResumeScore).filter_by(resume_name=row['Name']).first()
|
393 |
-
if resume_to_delete:
|
394 |
-
session.delete(resume_to_delete)
|
395 |
-
session.commit()
|
396 |
-
st.success(f"Deleted {row['Name']} from the database.")
|
397 |
-
st.experimental_set_query_params(refresh=True) # Use query params to trigger a rerun
|
398 |
-
|
399 |
-
# Display best-fit resumes
|
400 |
-
if not best_fits.empty:
|
401 |
-
st.subheader("Best Fit Resumes")
|
402 |
-
for index, row in best_fits.iterrows():
|
403 |
-
st.write(f"**{row['S.No']}. {row['Name']}**")
|
404 |
-
st.write(f"Score: {row['Score']}%")
|
405 |
-
st.write(f"Skills: {row['Skills']}")
|
406 |
-
st.write(f"Certifications: {row['Certifications']}")
|
407 |
-
st.write(f"Experience: {row['Experience (Years)']} years")
|
408 |
-
st.write(f"Education: {row['Education']}")
|
409 |
-
st.write(f"Projects: {row['Projects']}")
|
410 |
-
|
411 |
-
col1, col2 = st.columns([1, 1])
|
412 |
with col1:
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
st.write(f"### Skills: {row['Skills']}")
|
417 |
-
st.write(f"### Certifications: {row['Certifications']}")
|
418 |
-
st.write(f"### Experience: {row['Experience (Years)']} years")
|
419 |
-
st.write(f"### Education: {row['Education']}")
|
420 |
-
st.write("### Projects:")
|
421 |
-
st.text(row['Projects'])
|
422 |
with col2:
|
423 |
-
if st.button(f"
|
424 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
425 |
resume_to_delete = session.query(ResumeScore).filter_by(resume_name=row['Name']).first()
|
426 |
if resume_to_delete:
|
427 |
session.delete(resume_to_delete)
|
428 |
session.commit()
|
429 |
-
st.success(f"Deleted {row['Name']}
|
430 |
-
st.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
431 |
else:
|
432 |
st.write("No resume scores available.")
|
433 |
|
|
|
354 |
'Certifications': certifications_str,
|
355 |
'Experience (Years)': resume.experience_years,
|
356 |
'Education': resume.education_level,
|
357 |
+
'Projects': resume.summary
|
358 |
})
|
359 |
|
360 |
df = pd.DataFrame(data)
|
|
|
367 |
# Display all resumes
|
368 |
st.subheader("All Resumes")
|
369 |
for index, row in df_display.iterrows():
|
370 |
+
with st.container():
|
371 |
+
col1, col2, col3 = st.columns([3, 1, 1])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
372 |
with col1:
|
373 |
+
st.write(f"**{row['Name']}** (Score: {row['Score']}%)")
|
374 |
+
st.write(f"Skills: {row['Skills']}")
|
375 |
+
st.write(f"Experience: {row['Experience (Years)']} years")
|
|
|
|
|
|
|
|
|
|
|
|
|
376 |
with col2:
|
377 |
+
if st.button(f"View Details", key=f"view_{index}"):
|
378 |
+
st.write(f"### Analysis Report")
|
379 |
+
st.write(f"Skills: {row['Skills']}")
|
380 |
+
st.write(f"Certifications: {row['Certifications']}")
|
381 |
+
st.write(f"Experience: {row['Experience (Years)']} years")
|
382 |
+
st.write(f"Education: {row['Education']}")
|
383 |
+
st.write(f"Projects: {row['Projects']}")
|
384 |
+
with col3:
|
385 |
+
if st.button(f"Delete", key=f"delete_{index}"):
|
386 |
resume_to_delete = session.query(ResumeScore).filter_by(resume_name=row['Name']).first()
|
387 |
if resume_to_delete:
|
388 |
session.delete(resume_to_delete)
|
389 |
session.commit()
|
390 |
+
st.success(f"Deleted {row['Name']}")
|
391 |
+
st.rerun() # Use st.rerun() instead of experimental_set_query_params
|
392 |
+
|
393 |
+
# Display best-fit resumes
|
394 |
+
if not best_fits.empty:
|
395 |
+
st.subheader("Best Fit Resumes")
|
396 |
+
for index, row in best_fits.iterrows():
|
397 |
+
with st.container():
|
398 |
+
col1, col2, col3 = st.columns([3, 1, 1])
|
399 |
+
with col1:
|
400 |
+
st.write(f"**{row['Name']}** (Score: {row['Score']}%)")
|
401 |
+
st.write(f"Skills: {row['Skills']}")
|
402 |
+
st.write(f"Experience: {row['Experience (Years)']} years")
|
403 |
+
with col2:
|
404 |
+
if st.button(f"View Details", key=f"view_best_{index}"):
|
405 |
+
st.write(f"### Analysis Report")
|
406 |
+
st.write(f"Skills: {row['Skills']}")
|
407 |
+
st.write(f"Certifications: {row['Certifications']}")
|
408 |
+
st.write(f"Experience: {row['Experience (Years)']} years")
|
409 |
+
st.write(f"Education: {row['Education']}")
|
410 |
+
st.write(f"Projects: {row['Projects']}")
|
411 |
+
with col3:
|
412 |
+
if st.button(f"Delete", key=f"delete_best_{index}"):
|
413 |
+
resume_to_delete = session.query(ResumeScore).filter_by(resume_name=row['Name']).first()
|
414 |
+
if resume_to_delete:
|
415 |
+
session.delete(resume_to_delete)
|
416 |
+
session.commit()
|
417 |
+
st.success(f"Deleted {row['Name']}")
|
418 |
+
st.rerun() # Use st.rerun() instead of experimental_set_query_params
|
419 |
else:
|
420 |
st.write("No resume scores available.")
|
421 |
|