Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -182,29 +182,20 @@ with gr.Blocks(css=CSS, theme="Nymbo/Nymbo_Theme") as demo:
|
|
182 |
|
183 |
with gr.Tab("Cover Letter Generator"):
|
184 |
gr.HTML(COVER_LETTER_DISCLAIMER)
|
185 |
-
|
186 |
-
|
187 |
-
cl_job_description = gr.Textbox(label="Job Description", lines=5)
|
188 |
-
cl_resume_content = gr.Textbox(label="Resume Content", lines=10)
|
189 |
-
with gr.Column():
|
190 |
-
generate_cl_btn = gr.Button("Generate Cover Letter")
|
191 |
-
cover_letter_output = gr.Markdown()
|
192 |
|
193 |
-
with gr.Tab("Interview Questions"):
|
194 |
gr.HTML(INTERVIEW_QUESTIONS_DISCLAIMER)
|
195 |
-
|
196 |
-
|
197 |
-
iq_job_description = gr.Textbox(label="Job Description", lines=5)
|
198 |
-
with gr.Column():
|
199 |
-
generate_iq_btn = gr.Button("Generate Interview Questions")
|
200 |
-
interview_questions_output = gr.Markdown()
|
201 |
|
202 |
with gr.Accordion("⚙️ Parameters", open=False):
|
203 |
temperature = gr.Slider(
|
204 |
minimum=0, maximum=1, step=0.1, value=0.5, label="Temperature",
|
205 |
)
|
206 |
max_tokens = gr.Slider(
|
207 |
-
minimum=50, maximum=1024, step=1, value=
|
208 |
)
|
209 |
|
210 |
def update_job_description_visibility(with_job_description):
|
@@ -215,6 +206,7 @@ with gr.Blocks(css=CSS, theme="Nymbo/Nymbo_Theme") as demo:
|
|
215 |
inputs=[with_job_description],
|
216 |
outputs=[job_description]
|
217 |
)
|
|
|
218 |
def process_resume(file):
|
219 |
if file is not None:
|
220 |
file_type = file.name.split('.')[-1].lower()
|
@@ -238,6 +230,18 @@ with gr.Blocks(css=CSS, theme="Nymbo/Nymbo_Theme") as demo:
|
|
238 |
outputs=[rephrased_output]
|
239 |
)
|
240 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
241 |
gr.HTML(FOOTER_TEXT)
|
242 |
|
243 |
if __name__ == "__main__":
|
|
|
182 |
|
183 |
with gr.Tab("Cover Letter Generator"):
|
184 |
gr.HTML(COVER_LETTER_DISCLAIMER)
|
185 |
+
generate_cl_btn = gr.Button("Generate Cover Letter")
|
186 |
+
cover_letter_output = gr.Markdown()
|
|
|
|
|
|
|
|
|
|
|
187 |
|
188 |
+
with gr.Tab("Interview Questions Generator"):
|
189 |
gr.HTML(INTERVIEW_QUESTIONS_DISCLAIMER)
|
190 |
+
generate_iq_btn = gr.Button("Generate Interview Questions")
|
191 |
+
interview_questions_output = gr.Markdown()
|
|
|
|
|
|
|
|
|
192 |
|
193 |
with gr.Accordion("⚙️ Parameters", open=False):
|
194 |
temperature = gr.Slider(
|
195 |
minimum=0, maximum=1, step=0.1, value=0.5, label="Temperature",
|
196 |
)
|
197 |
max_tokens = gr.Slider(
|
198 |
+
minimum=50, maximum=1024, step=1, value=1024, label="Max tokens",
|
199 |
)
|
200 |
|
201 |
def update_job_description_visibility(with_job_description):
|
|
|
206 |
inputs=[with_job_description],
|
207 |
outputs=[job_description]
|
208 |
)
|
209 |
+
|
210 |
def process_resume(file):
|
211 |
if file is not None:
|
212 |
file_type = file.name.split('.')[-1].lower()
|
|
|
230 |
outputs=[rephrased_output]
|
231 |
)
|
232 |
|
233 |
+
generate_cl_btn.click(
|
234 |
+
generate_cover_letter,
|
235 |
+
inputs=[resume_content, job_description, temperature, max_tokens],
|
236 |
+
outputs=[cover_letter_output]
|
237 |
+
)
|
238 |
+
|
239 |
+
generate_iq_btn.click(
|
240 |
+
generate_interview_questions,
|
241 |
+
inputs=[job_description, temperature, max_tokens],
|
242 |
+
outputs=[interview_questions_output]
|
243 |
+
)
|
244 |
+
|
245 |
gr.HTML(FOOTER_TEXT)
|
246 |
|
247 |
if __name__ == "__main__":
|