Spaces:
Sleeping
Sleeping
Commit
·
c56aad1
1
Parent(s):
dc4415b
update ui
Browse files
app.py
CHANGED
@@ -12,10 +12,7 @@ def get_feedback(
|
|
12 |
experiences: str,
|
13 |
projects: str,
|
14 |
skills: str,
|
15 |
-
description: str
|
16 |
-
max_new_tokens: int,
|
17 |
-
top_p: float,
|
18 |
-
temperature: float
|
19 |
):
|
20 |
headers = {
|
21 |
'accept': 'application/json',
|
@@ -31,9 +28,9 @@ def get_feedback(
|
|
31 |
}
|
32 |
|
33 |
model_config = {
|
34 |
-
"max_new_tokens":
|
35 |
-
"top_p":
|
36 |
-
"temperature":
|
37 |
"do_sample": True
|
38 |
}
|
39 |
|
@@ -64,58 +61,99 @@ with gr.Blocks(theme=gr.themes.Base(font=[gr.themes.GoogleFont("Poppins")])) as
|
|
64 |
<div style="text-align: center; font-size: 18px; margin-bottom: 20px;">
|
65 |
A demo application that provides review on a resume against the job market using the G-Retriever framework, an LLM powered by a Knowledge Graph.
|
66 |
</div>
|
|
|
|
|
|
|
67 |
"""
|
68 |
)
|
69 |
with gr.Row(equal_height=True):
|
70 |
with gr.Column():
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
description = gr.Textbox(
|
85 |
label="Description",
|
86 |
-
lines=
|
|
|
|
|
87 |
)
|
88 |
-
submit = gr.Button("Get Feedback")
|
89 |
|
|
|
90 |
with gr.Column():
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
)
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
label="Top P",
|
105 |
-
interactive=True
|
106 |
)
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
label="Temperature",
|
113 |
-
interactive=True
|
114 |
)
|
115 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
submit.click(
|
117 |
fn=get_feedback,
|
118 |
-
inputs=[education, experience, project, skill, description, max_new_tokens, temperature, top_p],
|
119 |
outputs=[strengths, weaknesses, improvements],
|
120 |
# outputs=feedback,
|
121 |
show_progress=True
|
|
|
12 |
experiences: str,
|
13 |
projects: str,
|
14 |
skills: str,
|
15 |
+
description: str
|
|
|
|
|
|
|
16 |
):
|
17 |
headers = {
|
18 |
'accept': 'application/json',
|
|
|
28 |
}
|
29 |
|
30 |
model_config = {
|
31 |
+
"max_new_tokens": 512,
|
32 |
+
"top_p": 0.9,
|
33 |
+
"temperature": 0.4,
|
34 |
"do_sample": True
|
35 |
}
|
36 |
|
|
|
61 |
<div style="text-align: center; font-size: 18px; margin-bottom: 20px;">
|
62 |
A demo application that provides review on a resume against the job market using the G-Retriever framework, an LLM powered by a Knowledge Graph.
|
63 |
</div>
|
64 |
+
<div style="text-align: left; font-size: 14px; margin-bottom: 20px;">
|
65 |
+
*Currently, ReviceGraph only supports the English language.
|
66 |
+
</div>
|
67 |
"""
|
68 |
)
|
69 |
with gr.Row(equal_height=True):
|
70 |
with gr.Column():
|
71 |
+
gr.Markdown("### Input")
|
72 |
+
education = gr.Textbox(
|
73 |
+
label="Education",
|
74 |
+
lines=2,
|
75 |
+
placeholder="e.g. Bachelor Degree of Mathematics at Institut Teknologi Sepuluh Nopember",
|
76 |
+
info="The candidate's formal education."
|
77 |
+
)
|
78 |
+
experience = gr.Textbox(
|
79 |
+
label="Experiences",
|
80 |
+
lines=2,
|
81 |
+
placeholder="e.g. Data Scientist Intern at Bank Rakyat Indonesia",
|
82 |
+
info="The candidate's work experience and job descriptions. Could be intenship experience or professional experience."
|
83 |
+
)
|
84 |
+
project = gr.Textbox(
|
85 |
+
label="Projects",
|
86 |
+
lines=2,
|
87 |
+
placeholder="e.g. Chatbot for Customer Service using LLM",
|
88 |
+
info="Projects completed by the candidate and their description. Could be college project or internship project"
|
89 |
+
)
|
90 |
+
skill = gr.Textbox(
|
91 |
+
label="Skills",
|
92 |
+
lines=2,
|
93 |
+
placeholder="e.g. Python, Pytorch, Machine Learning, Deep Learning",
|
94 |
+
info="Skills possessed by the candidate. Could be technical skill, concept skill, or soft skill."
|
95 |
+
)
|
96 |
description = gr.Textbox(
|
97 |
label="Description",
|
98 |
+
lines=2,
|
99 |
+
placeholder="e.g. I want to pursue my career as machine learning engineer",
|
100 |
+
info="Candidate career orientation"
|
101 |
)
|
|
|
102 |
|
103 |
+
submit = gr.Button("Get Feedback")
|
104 |
with gr.Column():
|
105 |
+
# feedback = gr.Textbox(label="Feedback", interactive=False, lines=18)
|
106 |
+
gr.Markdown("### Output")
|
107 |
+
strengths = gr.Textbox(
|
108 |
+
label="Strengths",
|
109 |
+
lines=7,
|
110 |
+
interactive=False,
|
111 |
+
info="Potential reasons for the candidate to be accepted."
|
112 |
)
|
113 |
+
weaknesses = gr.Textbox(
|
114 |
+
label="Weaknesses",
|
115 |
+
lines=7,
|
116 |
+
interactive=False,
|
117 |
+
info="Potential reasons for the candidate to be rejected."
|
|
|
|
|
118 |
)
|
119 |
+
improvements = gr.Textbox(
|
120 |
+
label="Improvements",
|
121 |
+
lines=7,
|
122 |
+
interactive=False,
|
123 |
+
info="Recommendation for improvement on candidate's skills, experiences, or projects based on their weaknesses."
|
|
|
|
|
124 |
)
|
125 |
|
126 |
+
# with gr.Column():
|
127 |
+
# max_new_tokens = gr.Slider(
|
128 |
+
# minimum=256,
|
129 |
+
# maximum=512,
|
130 |
+
# value=512,
|
131 |
+
# step=1.0,
|
132 |
+
# info="Maximum number of tokens or words",
|
133 |
+
# label="Maximum Output Length",
|
134 |
+
# interactive=True
|
135 |
+
# )
|
136 |
+
# top_p = gr.Slider(
|
137 |
+
# minimum=0,
|
138 |
+
# maximum=1,
|
139 |
+
# value=0.9,
|
140 |
+
# step=0.01,
|
141 |
+
# label="Top P",
|
142 |
+
# interactive=True
|
143 |
+
# )
|
144 |
+
# temperature = gr.Slider(
|
145 |
+
# minimum=0.01,
|
146 |
+
# maximum=1,
|
147 |
+
# value=0.4,
|
148 |
+
# step=0.01,
|
149 |
+
# info="Define how creative the model to generates feedback.\nThe optimal value is 0.4.",
|
150 |
+
# label="Temperature",
|
151 |
+
# interactive=True
|
152 |
+
# )
|
153 |
+
|
154 |
submit.click(
|
155 |
fn=get_feedback,
|
156 |
+
inputs=[education, experience, project, skill, description], #, max_new_tokens, temperature, top_p],
|
157 |
outputs=[strengths, weaknesses, improvements],
|
158 |
# outputs=feedback,
|
159 |
show_progress=True
|