Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -15,6 +15,30 @@ def process_input(job_description, *resumes):
|
|
| 15 |
# formatted_output += f"Resume #{i}:\nScore: {score:.2f}\nResume Snippet: {resume[:200]}...\n\n-------\n\n"
|
| 16 |
# return formatted_output
|
| 17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
# UI definition
|
| 19 |
with gr.Blocks() as demo:
|
| 20 |
gr.Markdown("## π Resume Ranking System")
|
|
@@ -44,13 +68,21 @@ with gr.Blocks() as demo:
|
|
| 44 |
placeholder=f"Category #{i+1} description",
|
| 45 |
label=f"Description #{i+1}"
|
| 46 |
)
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
|
| 51 |
submit_btn.click(
|
| 52 |
fn=process_input,
|
| 53 |
-
inputs=[job_description] +
|
| 54 |
outputs=[thinking_output, output]
|
| 55 |
)
|
| 56 |
|
|
@@ -64,7 +96,7 @@ with gr.Blocks() as demo:
|
|
| 64 |
# resumes_list.append(new_input)
|
| 65 |
# return resumes_group.update(visible=True)
|
| 66 |
|
| 67 |
-
add_resume_btn = gr.Button("β Add Another
|
| 68 |
add_resume_btn.click(lambda x: x + 1, resume_count, resume_count)
|
| 69 |
|
| 70 |
with gr.Column():
|
|
@@ -86,7 +118,7 @@ with gr.Blocks() as demo:
|
|
| 86 |
interactive=False
|
| 87 |
)
|
| 88 |
|
| 89 |
-
submit_btn = gr.Button("π
|
| 90 |
|
| 91 |
|
| 92 |
# add_resume_btn.click(add_resume, outputs=resumes_group)
|
|
|
|
| 15 |
# formatted_output += f"Resume #{i}:\nScore: {score:.2f}\nResume Snippet: {resume[:200]}...\n\n-------\n\n"
|
| 16 |
# return formatted_output
|
| 17 |
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
initial_parsing = [
|
| 21 |
+
{"name":"education", "type":"List[str]","description":"attended school, university, and other education programs"},
|
| 22 |
+
{"name":"experience", "type":"float", "description":"years of experience"},
|
| 23 |
+
{"name":"skills", "type":"List[str]", "description":"list of skills"},
|
| 24 |
+
{"name":"name", "type":"str", "description":"name of the person"},
|
| 25 |
+
{"name":"location", "type":"str", "description":"location of the person"},
|
| 26 |
+
{"name":"email", "type":"str", "description":"email of the person"},
|
| 27 |
+
{"name":"websites", "type":"List[str]", "description":"urls related of the person"},
|
| 28 |
+
{"name":"certifications", "type":"List[str]", "description":"list of certifications"},
|
| 29 |
+
{"name":"languages", "type":"List[str]", "description":"list of languages"},
|
| 30 |
+
{"name":"projects", "type":"List[str]", "description":"list of projects"},
|
| 31 |
+
{"name":"note", "type":"str", "description":"additional note which highlight the best or uniqueness of the person"}
|
| 32 |
+
]
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
def update_json(data, name, data_type, desc):
|
| 36 |
+
data.append(
|
| 37 |
+
{"name":name, "type":data_type, "description":desc}
|
| 38 |
+
)
|
| 39 |
+
return data
|
| 40 |
+
|
| 41 |
+
|
| 42 |
# UI definition
|
| 43 |
with gr.Blocks() as demo:
|
| 44 |
gr.Markdown("## π Resume Ranking System")
|
|
|
|
| 68 |
placeholder=f"Category #{i+1} description",
|
| 69 |
label=f"Description #{i+1}"
|
| 70 |
)
|
| 71 |
+
|
| 72 |
+
json_display = gr.JSON(value=initial_parsing, label="Parsing Categories")
|
| 73 |
+
update_json_button = gr.Button("Update Parsing")
|
| 74 |
+
update_json_button.click(update_json, inputs=[json_display, name, data_type, desc], outputs=json_display)
|
| 75 |
+
|
| 76 |
+
# resumes_list.append(
|
| 77 |
+
# {"name":name, "type":data_type, "description":desc}
|
| 78 |
+
# )
|
| 79 |
+
# resumes_list.append(name)
|
| 80 |
+
# resumes_list.append(data_type)
|
| 81 |
+
# resumes_list.append(desc)
|
| 82 |
|
| 83 |
submit_btn.click(
|
| 84 |
fn=process_input,
|
| 85 |
+
inputs=[job_description] + json_display,
|
| 86 |
outputs=[thinking_output, output]
|
| 87 |
)
|
| 88 |
|
|
|
|
| 96 |
# resumes_list.append(new_input)
|
| 97 |
# return resumes_group.update(visible=True)
|
| 98 |
|
| 99 |
+
add_resume_btn = gr.Button("β Add Another Category")
|
| 100 |
add_resume_btn.click(lambda x: x + 1, resume_count, resume_count)
|
| 101 |
|
| 102 |
with gr.Column():
|
|
|
|
| 118 |
interactive=False
|
| 119 |
)
|
| 120 |
|
| 121 |
+
submit_btn = gr.Button("π Parse Resume / CV")
|
| 122 |
|
| 123 |
|
| 124 |
# add_resume_btn.click(add_resume, outputs=resumes_group)
|