Update app.py
Browse files
app.py
CHANGED
|
@@ -262,7 +262,6 @@ def analyze_cv_match(cv_file_obj, cv_text_input, jd_text_input):
|
|
| 262 |
try:
|
| 263 |
analysis_results = perform_cv_job_analysis(cv_content, jd_text_input)
|
| 264 |
|
| 265 |
-
# Using helper variables for clarity and to prevent syntax issues in f-strings
|
| 266 |
matched_skills_str = ', '.join(analysis_results['matched_skills']) if analysis_results['matched_skills'] else 'None found matching job description.'
|
| 267 |
missing_skills_str = ', '.join(analysis_results['missing_skills']) if analysis_results['missing_skills'] else '🥳 None! Your CV has all specified skills.'
|
| 268 |
extra_skills_str = ', '.join(analysis_results['extra_skills_in_cv']) if analysis_results['extra_skills_in_cv'] else 'None. (This is often fine, showing broader capability.)'
|
|
@@ -270,7 +269,6 @@ def analyze_cv_match(cv_file_obj, cv_text_input, jd_text_input):
|
|
| 270 |
cv_keywords_str = ', '.join(analysis_results['top_cv_keywords']) if analysis_results['top_cv_keywords'] else 'N/A'
|
| 271 |
jd_keywords_str = ', '.join(analysis_results['top_jd_keywords']) if analysis_results['top_jd_keywords'] else 'N/A'
|
| 272 |
|
| 273 |
-
# Build the HTML string piece by piece
|
| 274 |
html_output = f"""
|
| 275 |
<h2 style='text-align: center;'>💡 Analysis Results Summary 💡</h2>
|
| 276 |
<div style='display: flex; justify-content: space-around; flex-wrap: wrap; text-align: center; margin-bottom: 20px;'>
|
|
@@ -306,7 +304,6 @@ def analyze_cv_match(cv_file_obj, cv_text_input, jd_text_input):
|
|
| 306 |
<p style='color:green;'><strong>Status:</strong> {analysis_results['education_match_status']}</p>
|
| 307 |
"""
|
| 308 |
|
| 309 |
-
# Generate plots
|
| 310 |
overall_plot = create_overall_match_plot(analysis_results['overall_match_score'])
|
| 311 |
skill_plot = create_skill_match_plot(analysis_results['matched_skills'], analysis_results['missing_skills'])
|
| 312 |
keywords_plot = create_top_keywords_plot(analysis_results['top_cv_keywords'], analysis_results['top_jd_keywords'])
|
|
@@ -321,8 +318,8 @@ def analyze_cv_match(cv_file_obj, cv_text_input, jd_text_input):
|
|
| 321 |
# --- Gradio Interface Definition ---
|
| 322 |
with gr.Blocks(theme=gr.themes.Soft(), title="CV-Job Match Analyzer") as demo:
|
| 323 |
|
| 324 |
-
#
|
| 325 |
-
gr.HTML("<style>#root{padding-top:
|
| 326 |
|
| 327 |
gr.Markdown(
|
| 328 |
"""
|
|
@@ -332,7 +329,6 @@ with gr.Blocks(theme=gr.themes.Soft(), title="CV-Job Match Analyzer") as demo:
|
|
| 332 |
"""
|
| 333 |
)
|
| 334 |
|
| 335 |
-
# Using gr.Row and gr.Column for compatibility with older Gradio versions
|
| 336 |
with gr.Row():
|
| 337 |
with gr.Column(scale=1):
|
| 338 |
gr.Markdown("## **1. Your CV**")
|
|
@@ -357,4 +353,4 @@ with gr.Blocks(theme=gr.themes.Soft(), title="CV-Job Match Analyzer") as demo:
|
|
| 357 |
outputs=[output_html, output_overall_plot, output_skill_plot, output_keywords_plot, gr.State(value="")],
|
| 358 |
)
|
| 359 |
|
| 360 |
-
demo.launch()
|
|
|
|
| 262 |
try:
|
| 263 |
analysis_results = perform_cv_job_analysis(cv_content, jd_text_input)
|
| 264 |
|
|
|
|
| 265 |
matched_skills_str = ', '.join(analysis_results['matched_skills']) if analysis_results['matched_skills'] else 'None found matching job description.'
|
| 266 |
missing_skills_str = ', '.join(analysis_results['missing_skills']) if analysis_results['missing_skills'] else '🥳 None! Your CV has all specified skills.'
|
| 267 |
extra_skills_str = ', '.join(analysis_results['extra_skills_in_cv']) if analysis_results['extra_skills_in_cv'] else 'None. (This is often fine, showing broader capability.)'
|
|
|
|
| 269 |
cv_keywords_str = ', '.join(analysis_results['top_cv_keywords']) if analysis_results['top_cv_keywords'] else 'N/A'
|
| 270 |
jd_keywords_str = ', '.join(analysis_results['top_jd_keywords']) if analysis_results['top_jd_keywords'] else 'N/A'
|
| 271 |
|
|
|
|
| 272 |
html_output = f"""
|
| 273 |
<h2 style='text-align: center;'>💡 Analysis Results Summary 💡</h2>
|
| 274 |
<div style='display: flex; justify-content: space-around; flex-wrap: wrap; text-align: center; margin-bottom: 20px;'>
|
|
|
|
| 304 |
<p style='color:green;'><strong>Status:</strong> {analysis_results['education_match_status']}</p>
|
| 305 |
"""
|
| 306 |
|
|
|
|
| 307 |
overall_plot = create_overall_match_plot(analysis_results['overall_match_score'])
|
| 308 |
skill_plot = create_skill_match_plot(analysis_results['matched_skills'], analysis_results['missing_skills'])
|
| 309 |
keywords_plot = create_top_keywords_plot(analysis_results['top_cv_keywords'], analysis_results['top_jd_keywords'])
|
|
|
|
| 318 |
# --- Gradio Interface Definition ---
|
| 319 |
with gr.Blocks(theme=gr.themes.Soft(), title="CV-Job Match Analyzer") as demo:
|
| 320 |
|
| 321 |
+
# Increased padding to 100px to ensure visibility
|
| 322 |
+
gr.HTML("<style>#root{padding-top: 100px !important;}</style>")
|
| 323 |
|
| 324 |
gr.Markdown(
|
| 325 |
"""
|
|
|
|
| 329 |
"""
|
| 330 |
)
|
| 331 |
|
|
|
|
| 332 |
with gr.Row():
|
| 333 |
with gr.Column(scale=1):
|
| 334 |
gr.Markdown("## **1. Your CV**")
|
|
|
|
| 353 |
outputs=[output_html, output_overall_plot, output_skill_plot, output_keywords_plot, gr.State(value="")],
|
| 354 |
)
|
| 355 |
|
| 356 |
+
demo.launch()
|