Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -130,12 +130,49 @@ def resume_agent(file_path, location):
|
|
| 130 |
|
| 131 |
|
| 132 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 133 |
with gr.Blocks() as demo:
|
| 134 |
gr.Markdown("# Resume Feedback and Job Matching Tool")
|
|
|
|
| 135 |
|
| 136 |
-
with gr.
|
| 137 |
-
with gr.
|
| 138 |
-
resume_upload = gr.File(label="Upload Your Resume (PDF or DOCX)")
|
| 139 |
location_input = gr.Textbox(label="Preferred Location", placeholder="e.g., San Francisco")
|
| 140 |
submit_button = gr.Button("Submit")
|
| 141 |
|
|
@@ -147,15 +184,16 @@ with gr.Blocks() as demo:
|
|
| 147 |
# Define the click event for the submit button
|
| 148 |
def format_outputs(feedback, improved_resume, job_roles):
|
| 149 |
# Add bold headings to each section
|
| 150 |
-
feedback_with_heading = f"
|
| 151 |
-
improved_resume_with_heading = f"
|
| 152 |
-
job_roles_with_heading = f"
|
| 153 |
return feedback_with_heading, improved_resume_with_heading, job_roles_with_heading
|
| 154 |
|
| 155 |
submit_button.click(
|
| 156 |
resume_agent,
|
| 157 |
inputs=[resume_upload, location_input],
|
| 158 |
-
outputs=[feedback_output, improved_resume_output, job_roles_output]
|
|
|
|
| 159 |
).then(
|
| 160 |
format_outputs,
|
| 161 |
inputs=[feedback_output, improved_resume_output, job_roles_output],
|
|
|
|
| 130 |
|
| 131 |
|
| 132 |
|
| 133 |
+
# with gr.Blocks() as demo:
|
| 134 |
+
# gr.Markdown("# Resume Feedback and Job Matching Tool")
|
| 135 |
+
|
| 136 |
+
# with gr.Row():
|
| 137 |
+
# with gr.Column():
|
| 138 |
+
# resume_upload = gr.File(label="Upload Your Resume (PDF or DOCX)")
|
| 139 |
+
# location_input = gr.Textbox(label="Preferred Location", placeholder="e.g., San Francisco")
|
| 140 |
+
# submit_button = gr.Button("Submit")
|
| 141 |
+
|
| 142 |
+
# with gr.Column():
|
| 143 |
+
# feedback_output = gr.Markdown(label="Resume Feedback")
|
| 144 |
+
# improved_resume_output = gr.Markdown(label="Improved Resume")
|
| 145 |
+
# job_roles_output = gr.Markdown(label="Relevant Job Roles")
|
| 146 |
+
|
| 147 |
+
# # Define the click event for the submit button
|
| 148 |
+
# def format_outputs(feedback, improved_resume, job_roles):
|
| 149 |
+
# # Add bold headings to each section
|
| 150 |
+
# feedback_with_heading = f"**RESUME FEEDBACK:**\n\n{feedback}"
|
| 151 |
+
# improved_resume_with_heading = f"**IMPROVED RESUME:**\n\n{improved_resume}"
|
| 152 |
+
# job_roles_with_heading = f"**RELEVANT JOB ROLES:**\n\n{job_roles}"
|
| 153 |
+
# return feedback_with_heading, improved_resume_with_heading, job_roles_with_heading
|
| 154 |
+
|
| 155 |
+
# submit_button.click(
|
| 156 |
+
# resume_agent,
|
| 157 |
+
# inputs=[resume_upload, location_input],
|
| 158 |
+
# outputs=[feedback_output, improved_resume_output, job_roles_output]
|
| 159 |
+
# ).then(
|
| 160 |
+
# format_outputs,
|
| 161 |
+
# inputs=[feedback_output, improved_resume_output, job_roles_output],
|
| 162 |
+
# outputs=[feedback_output, improved_resume_output, job_roles_output]
|
| 163 |
+
# )
|
| 164 |
+
|
| 165 |
+
# demo.launch()
|
| 166 |
+
|
| 167 |
+
|
| 168 |
+
# Gradio Interface
|
| 169 |
with gr.Blocks() as demo:
|
| 170 |
gr.Markdown("# Resume Feedback and Job Matching Tool")
|
| 171 |
+
gr.Markdown("*Expected Runtime: 1 Min*")
|
| 172 |
|
| 173 |
+
with gr.Column():
|
| 174 |
+
with gr.Row():
|
| 175 |
+
resume_upload = gr.File(label="Upload Your Resume (PDF or DOCX)", height=120)
|
| 176 |
location_input = gr.Textbox(label="Preferred Location", placeholder="e.g., San Francisco")
|
| 177 |
submit_button = gr.Button("Submit")
|
| 178 |
|
|
|
|
| 184 |
# Define the click event for the submit button
|
| 185 |
def format_outputs(feedback, improved_resume, job_roles):
|
| 186 |
# Add bold headings to each section
|
| 187 |
+
feedback_with_heading = f"## Resume Feedback:**\n\n{feedback}"
|
| 188 |
+
improved_resume_with_heading = f"## Improved Resume:\n\n{improved_resume}"
|
| 189 |
+
job_roles_with_heading = f"## Relevant Job Roles:\n\n{job_roles}"
|
| 190 |
return feedback_with_heading, improved_resume_with_heading, job_roles_with_heading
|
| 191 |
|
| 192 |
submit_button.click(
|
| 193 |
resume_agent,
|
| 194 |
inputs=[resume_upload, location_input],
|
| 195 |
+
outputs=[feedback_output, improved_resume_output, job_roles_output],
|
| 196 |
+
show_progress=True
|
| 197 |
).then(
|
| 198 |
format_outputs,
|
| 199 |
inputs=[feedback_output, improved_resume_output, job_roles_output],
|