Upload 2 files
Browse files- app.py +412 -111
- requirements.txt +1 -0
app.py
CHANGED
@@ -1,12 +1,12 @@
|
|
1 |
#!/usr/bin/env python
|
2 |
# coding: utf-8
|
3 |
|
4 |
-
# In[
|
5 |
|
6 |
|
7 |
import os
|
8 |
import jinja2
|
9 |
-
import openai
|
10 |
import pdfkit
|
11 |
#import random
|
12 |
#import re
|
@@ -45,7 +45,7 @@ output_parser = CommaSeparatedListOutputParser()
|
|
45 |
format_instructions = output_parser.get_format_instructions()
|
46 |
|
47 |
|
48 |
-
# In[
|
49 |
|
50 |
|
51 |
#定义常用函数
|
@@ -57,9 +57,9 @@ def company_cr(target_company,language,key):
|
|
57 |
chat_0_3 = ChatOpenAI(temperature = 0.0,openai_api_key = key)
|
58 |
pTem_tar_c = ChatPromptTemplate.from_template(tar_com_prompt)
|
59 |
prompt_c = pTem_tar_c.format_messages(company = target_company,lang = language,format_instructions = format_instructions)
|
60 |
-
print(prompt_c)
|
61 |
mock_exp_company = chat_0_3(prompt_c)
|
62 |
-
print(mock_exp_company)
|
63 |
mock_exp_company_fin = mock_exp_company.content.split(',')
|
64 |
return mock_exp_company_fin
|
65 |
|
@@ -71,9 +71,9 @@ def job_cr(target_job,language,key):
|
|
71 |
pTem_tar_j = ChatPromptTemplate.from_template(tar_job_prompt)
|
72 |
prompt_j = pTem_tar_j.format_messages(job = target_job,lang = language,format_instructions = format_instructions)
|
73 |
mock_exp_job = chat_0_3(prompt_j)
|
74 |
-
print(mock_exp_job)
|
75 |
mock_exp_job_fin = mock_exp_job.content.split(',')
|
76 |
-
print(mock_exp_job_fin)
|
77 |
return mock_exp_job_fin
|
78 |
|
79 |
#工作一级技能函数
|
@@ -84,9 +84,9 @@ def skill_pri_cr(job_req,key):
|
|
84 |
pTem_tar_skill = ChatPromptTemplate.from_template(tar_skill_pri_prompt)
|
85 |
prompt_skill = pTem_tar_skill.format_messages(job_requirement = job_req,format_instructions = format_instructions)
|
86 |
mock_skill_pri = chat_0_4(prompt_skill)
|
87 |
-
print(mock_skill_pri)
|
88 |
mock_skill_pri_fin = mock_skill_pri.content.split(',')
|
89 |
-
print(mock_skill_pri_fin)
|
90 |
return mock_skill_pri_fin
|
91 |
|
92 |
|
@@ -94,16 +94,16 @@ def skill_pri_cr(job_req,key):
|
|
94 |
def skill_sec_cr(skill_pri,language,key):
|
95 |
tar_skill_sec_prompt = """ Assume you are the recruiter, read the skill sets in {skill_pri}, list 5 related tech terms for each skill set you want to see on candidates resume in {lang}.\n{format_instructions}
|
96 |
"""
|
97 |
-
|
98 |
-
chat_0_3 = ChatOpenAI(temperature = 0.0,openai_api_key = key)
|
99 |
pTem_tar_skill_sec = ChatPromptTemplate.from_template(tar_skill_sec_prompt)
|
100 |
prompt_skill_sec = pTem_tar_skill_sec.format_messages(skill_pri = skill_pri,lang = language,format_instructions = format_instructions)
|
101 |
|
102 |
-
mock_skill_sec = chat_0_3(prompt_skill_sec)
|
103 |
-
|
104 |
-
print(mock_skill_sec)
|
105 |
mock_skill_sec_fin = mock_skill_sec.content.split(',')
|
106 |
-
print(mock_skill_sec_fin)
|
107 |
return mock_skill_sec_fin
|
108 |
|
109 |
#社团生成函数
|
@@ -115,9 +115,9 @@ def soc_cr(target_job,language,key):
|
|
115 |
prompt_soc = pTem_tar_soc.format_messages(job_name = target_job,lang = language,format_instructions = format_instructions)
|
116 |
|
117 |
mock_exp_soc = chat_0_4(prompt_soc)
|
118 |
-
print(mock_exp_soc)
|
119 |
mock_exp_soc_fin = mock_exp_soc.content.split(',')
|
120 |
-
print(mock_exp_soc_fin)
|
121 |
|
122 |
return mock_exp_soc_fin
|
123 |
|
@@ -132,14 +132,14 @@ def work_exp(mock_company,mock_title,mock_skill,language,key):
|
|
132 |
|
133 |
|
134 |
mock_working_exp = chat_0_4(prompt_working_exp)
|
135 |
-
print(mock_working_exp)
|
136 |
mock_working_exp_fin = r_splitter.split_text(mock_working_exp.content)
|
137 |
-
print(mock_working_exp_fin)
|
138 |
result = [mock_working_exp_fin[0],mock_working_exp_fin[1],mock_working_exp_fin[2]]
|
139 |
|
140 |
|
141 |
-
print(mock_working_exp_fin[3])
|
142 |
-
print(result)
|
143 |
return (mock_working_exp_fin[0],mock_working_exp_fin[1],mock_working_exp_fin[2])
|
144 |
|
145 |
|
@@ -148,24 +148,24 @@ def club_exp(mock_soc,mock_skill_soc,language,key):
|
|
148 |
chat_0_4 = ChatOpenAI(temperature = 0.0,model_name = 'gpt-4',openai_api_key = key)
|
149 |
#n_range = range(0,80)
|
150 |
#rand_value = random.sample(n_range,4)
|
151 |
-
print(rand_value)
|
152 |
|
153 |
mock_skill_soc_fin = np.array(mock_skill_soc)[rand_value]
|
154 |
|
155 |
pTem_tar_club_exp = ChatPromptTemplate.from_template(club_exp_prompt)
|
156 |
prompt_club_exp = pTem_tar_club_exp.format_messages(club = mock_soc,lang = language,skill_sec_club = mock_skill_soc_fin)
|
157 |
|
158 |
-
print(pTem_tar_club_exp)
|
159 |
-
print(prompt_club_exp)
|
160 |
|
161 |
|
162 |
mock_club_exp = chat_0_4(prompt_club_exp)
|
163 |
-
print(mock_club_exp)
|
164 |
|
165 |
mock_club_exp_fin = r_splitter.split_text(mock_club_exp.content)
|
166 |
-
print(mock_club_exp_fin)
|
167 |
|
168 |
-
print(mock_club_exp_fin[0])
|
169 |
|
170 |
return mock_club_exp_fin
|
171 |
|
@@ -183,12 +183,56 @@ def skill_info(job_req,language,key):
|
|
183 |
|
184 |
|
185 |
return mock_skill_sec
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
186 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
187 |
|
188 |
|
189 |
|
190 |
#简历排版函数
|
191 |
-
def resume(name,mobile,email,Gra_beg,Gra_end,Gra_sch,Gra_maj,underGra_beg,underGra_end,underGra_sch,underGra_maj,exp_one_beg,exp_one_end,exp_one_com,exp_one_title,exp_one_1,exp_one_2,exp_one_3,exp_two_beg,exp_two_end,exp_two_com,exp_two_title,exp_two_1,exp_two_2,exp_two_3,exp_three_beg,exp_three_end,exp_three_com,exp_three_title,exp_three_1,exp_three_2,exp_three_3):
|
192 |
|
193 |
# 生成html和pdf
|
194 |
|
@@ -198,18 +242,18 @@ def resume(name,mobile,email,Gra_beg,Gra_end,Gra_sch,Gra_maj,underGra_beg,underG
|
|
198 |
<main role="main">
|
199 |
<div class="page"><!-- 1. Header -->
|
200 |
<h1 style="text-align: center;">{name}</h1>
|
201 |
-
<p style="text-align: center;"
|
202 |
<hr /><!-- 2a. Resume Content -->
|
203 |
<section class="resume_content">
|
204 |
<article>
|
205 |
-
<h3
|
206 |
<div style="float: left;">{Gra_beg}-{Gra_end} <strong>{Gra_sch}</strong></div>
|
207 |
-
<div style="float: right;">{Gra_maj} <strong
|
208 |
<br />
|
209 |
<div style="float: left;">{underGra_beg}-{underGra_end} <strong>{underGra_sch}</strong></div>
|
210 |
-
<div style="float: right;">{underGra_maj} <strong
|
211 |
<br /><hr />
|
212 |
-
<h3
|
213 |
<section>
|
214 |
<div style="float: left;">{exp_one_beg}-{exp_one_end} <strong>{exp_one_com}</strong></div>
|
215 |
<div style="float: right;"><strong>{exp_one_title}</strong></div>
|
@@ -235,6 +279,14 @@ def resume(name,mobile,email,Gra_beg,Gra_end,Gra_sch,Gra_maj,underGra_beg,underG
|
|
235 |
<p><li>{exp_three_2}</li></p>
|
236 |
<p><li>{exp_three_3}</li></p>
|
237 |
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
238 |
</article>
|
239 |
</section>
|
240 |
</div>
|
@@ -244,11 +296,11 @@ def resume(name,mobile,email,Gra_beg,Gra_end,Gra_sch,Gra_maj,underGra_beg,underG
|
|
244 |
"""
|
245 |
|
246 |
|
247 |
-
pdfkit.from_string(body,
|
248 |
|
249 |
|
250 |
|
251 |
-
return
|
252 |
|
253 |
|
254 |
# In[ ]:
|
@@ -257,7 +309,7 @@ def resume(name,mobile,email,Gra_beg,Gra_end,Gra_sch,Gra_maj,underGra_beg,underG
|
|
257 |
|
258 |
|
259 |
|
260 |
-
# In[
|
261 |
|
262 |
|
263 |
# Json输入,Dropdown更新函数
|
@@ -287,6 +339,15 @@ def Button_visible():
|
|
287 |
#文本框提交输出文本值
|
288 |
def Textbox_value_os(str_in):
|
289 |
return gr.Textbox.update(value = str_in)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
290 |
|
291 |
|
292 |
|
@@ -299,123 +360,363 @@ with gr.Blocks() as demo:
|
|
299 |
#openai_gpt4_key = gr.Textbox(label="OpenAI GPT4 Key", value="", type="password", placeholder="sk..", info = "You have to provide your own GPT4 keys for this app to function properly",)
|
300 |
#key = str(txt_openAI_key.change(Textbox_value_submit, inputs =txt_openAI_key))
|
301 |
#print(key)
|
302 |
-
txt_key = gr.Textbox(type="password", placeholder="sk..",label = "key")
|
303 |
#print(openai_gpt4_key)
|
304 |
-
txt_key.change(Textbox_value_os,inputs = txt_key)
|
305 |
txt_tarcom_in = gr.Textbox(label = "Target Company",info = "e.g. Amazon")
|
306 |
txt_tarjob_in = gr.Textbox(label = "Target Job",info = "e.g. Data Analyst")
|
307 |
txt_jd_in = gr.Textbox(label = "Job Responsibility",info = "e.g. - Write high quality distributed system software- Build production quality and large scale deployment of applications related to NLP and ML- Use software engineering best practices to ensure a high standard of quality for all team deliverables- Design, implement, test, deploy and maintain innovative software solutions to transform service performance, stability, cost and security- Help drive business decisions with your technical input- Work in an agile, startup-like development environment, where you're always working on the most important stuff")
|
308 |
-
txt_lang_in = gr.Dropdown(["
|
309 |
btn_resume_info = gr.Button(value="Analyze Target Job")
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
mobile = gr.Textbox(label = "Mobile")
|
315 |
-
email = gr.Textbox(label = "Email")
|
316 |
-
with gr.Row():
|
317 |
-
Gra_beg = gr.Textbox(label = "Graduate School Beginning Year")
|
318 |
-
Gra_end = gr.Textbox(label = "Graduate School End Year")
|
319 |
-
Gra_sch = gr.Textbox(label = "Graduate School Name")
|
320 |
-
Gra_maj = gr.Textbox(label = "Graduate School Major")
|
321 |
-
with gr.Row():
|
322 |
-
underGra_beg = gr.Textbox(label = "Undergraduate School Beginning Year")
|
323 |
-
underGra_end = gr.Textbox(label = "Undergraduate School End Year")
|
324 |
-
underGra_sch = gr.Textbox(label = "Undergraduate School Name")
|
325 |
-
underGra_maj = gr.Textbox(label = "Undergraduate School Major")
|
326 |
-
btn_resume_pre = gr.Button(value = "Preview Resume",visible = False)
|
327 |
-
js_com_out = gr.JSON(label = "Company output")
|
328 |
js_title_out = gr.JSON(label = "Proper Title",visible = False)
|
329 |
js_sec_skill_out = gr.JSON(label = "Output",visible = False)
|
330 |
js_club_out = gr.JSON(label = "Output",visible = False)
|
331 |
#dd_com_in = gr.Dropdown(options)
|
332 |
-
|
333 |
-
btn_resume_info.click(company_cr, inputs = [txt_tarcom_in, txt_lang_in, txt_key], outputs = js_com_out)
|
334 |
-
btn_resume_info.click(job_cr, inputs = [txt_tarjob_in, txt_lang_in,txt_key], outputs = js_title_out)
|
335 |
-
btn_resume_info.click(skill_info, inputs = [txt_jd_in, txt_lang_in,txt_key], outputs = js_sec_skill_out)
|
336 |
-
|
337 |
-
|
338 |
-
btn_resume_info.click(Button_visible,outputs = btn_exp_gen,queue = True)
|
339 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
340 |
|
|
|
341 |
|
342 |
|
343 |
with gr.Row():
|
344 |
-
exp_com_one = gr.Textbox(value = options,label="Company Name")
|
345 |
-
exp_title_one = gr.Textbox(value = options,label="Title Name")
|
346 |
-
time_beg_one = gr.Textbox(value = '2016')
|
347 |
-
time_end_one = gr.Textbox(value = '2017')
|
348 |
exp_skill_one = gr.Dropdown(value = options, label = "Skill",multiselect = True,visible = False)
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
btn_exp_gen.click(Textbox_value,inputs = [js_com_out,num_one],outputs = exp_com_one)
|
354 |
-
btn_exp_gen.click(Textbox_value,inputs = [js_title_out,num_one],outputs = exp_title_one)
|
355 |
-
btn_exp_gen.click(Dropdown_value_rand,inputs = [js_sec_skill_out,num_rand],outputs = exp_skill_one)
|
356 |
|
357 |
|
358 |
-
|
359 |
-
|
360 |
-
|
|
|
|
|
|
|
|
|
361 |
btn_work_exp_one = gr.Button(value = "Update Working Experience One",visible = False)
|
362 |
|
363 |
-
|
|
|
364 |
|
365 |
|
366 |
|
367 |
with gr.Row():
|
368 |
-
exp_com_two = gr.Textbox(value = options,label="Company Name")
|
369 |
-
exp_title_two = gr.Textbox(value = options,label="Title Name")
|
370 |
-
time_beg_two = gr.Textbox(value = '2016')
|
371 |
-
time_end_two = gr.Textbox(value = '2017')
|
372 |
exp_skill_two = gr.Dropdown(value = options, label = "Skill",multiselect = True,visible = False)
|
373 |
-
btn_exp_gen.click(Textbox_value,inputs = [js_com_out,num_two],outputs = exp_com_two)
|
374 |
-
btn_exp_gen.click(Textbox_value,inputs = [js_title_out,num_two],outputs = exp_title_two)
|
375 |
-
btn_exp_gen.click(Dropdown_value_rand,inputs = [js_sec_skill_out,num_rand],outputs = exp_skill_two)
|
376 |
|
377 |
-
|
378 |
-
|
379 |
-
|
|
|
|
|
|
|
|
|
|
|
380 |
btn_work_exp_two = gr.Button(value = "Update Working Experience Two",visible = False)
|
381 |
|
382 |
-
|
|
|
383 |
|
384 |
|
385 |
|
386 |
|
387 |
|
388 |
with gr.Row():
|
389 |
-
exp_com_three = gr.Textbox(value = options,label="Company Name")
|
390 |
-
exp_title_three = gr.Textbox(value = options,label="Title Name")
|
391 |
-
time_beg_three = gr.Textbox(value = '2016')
|
392 |
-
time_end_three = gr.Textbox(value = '2017')
|
393 |
exp_skill_three = gr.Dropdown(value = options, label = "Skill",multiselect = True,visible = False)
|
394 |
-
btn_exp_gen.click(Textbox_value,inputs = [js_com_out,num_three],outputs = exp_com_three)
|
395 |
-
btn_exp_gen.click(Textbox_value,inputs = [js_title_out,num_one],outputs = exp_title_three)
|
396 |
-
btn_exp_gen.click(Dropdown_value_rand,inputs = [js_sec_skill_out,num_rand],outputs = exp_skill_three)
|
397 |
|
398 |
-
|
399 |
-
|
400 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
401 |
btn_work_exp_three = gr.Button(value = "Update Working Experience Three",visible = False)
|
|
|
|
|
402 |
|
403 |
-
|
|
|
|
|
|
|
|
|
|
|
404 |
|
|
|
|
|
405 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
406 |
|
407 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
408 |
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
416 |
|
417 |
-
btn_resume_pre.click(resume,inputs = [name,mobile,email,Gra_beg,Gra_end,Gra_sch,Gra_maj,underGra_beg,underGra_end,underGra_sch,underGra_maj,time_beg_one,time_end_one,exp_com_one,exp_title_one,exp_txt_one_1,exp_txt_one_2,exp_txt_one_3,time_beg_two,time_end_two,exp_com_two,exp_title_two,exp_txt_two_1,exp_txt_two_2,exp_txt_two_3,time_beg_three,time_end_three,exp_com_three,exp_title_three,exp_txt_three_1,exp_txt_three_2,exp_txt_three_3],outputs = webpage)
|
418 |
-
|
419 |
|
420 |
if __name__ == "__main__":
|
421 |
demo.launch(enable_queue = True)
|
|
|
1 |
#!/usr/bin/env python
|
2 |
# coding: utf-8
|
3 |
|
4 |
+
# In[35]:
|
5 |
|
6 |
|
7 |
import os
|
8 |
import jinja2
|
9 |
+
#import openai
|
10 |
import pdfkit
|
11 |
#import random
|
12 |
#import re
|
|
|
45 |
format_instructions = output_parser.get_format_instructions()
|
46 |
|
47 |
|
48 |
+
# In[56]:
|
49 |
|
50 |
|
51 |
#定义常用函数
|
|
|
57 |
chat_0_3 = ChatOpenAI(temperature = 0.0,openai_api_key = key)
|
58 |
pTem_tar_c = ChatPromptTemplate.from_template(tar_com_prompt)
|
59 |
prompt_c = pTem_tar_c.format_messages(company = target_company,lang = language,format_instructions = format_instructions)
|
60 |
+
#print(prompt_c)
|
61 |
mock_exp_company = chat_0_3(prompt_c)
|
62 |
+
#print(mock_exp_company)
|
63 |
mock_exp_company_fin = mock_exp_company.content.split(',')
|
64 |
return mock_exp_company_fin
|
65 |
|
|
|
71 |
pTem_tar_j = ChatPromptTemplate.from_template(tar_job_prompt)
|
72 |
prompt_j = pTem_tar_j.format_messages(job = target_job,lang = language,format_instructions = format_instructions)
|
73 |
mock_exp_job = chat_0_3(prompt_j)
|
74 |
+
#print(mock_exp_job)
|
75 |
mock_exp_job_fin = mock_exp_job.content.split(',')
|
76 |
+
#print(mock_exp_job_fin)
|
77 |
return mock_exp_job_fin
|
78 |
|
79 |
#工作一级技能函数
|
|
|
84 |
pTem_tar_skill = ChatPromptTemplate.from_template(tar_skill_pri_prompt)
|
85 |
prompt_skill = pTem_tar_skill.format_messages(job_requirement = job_req,format_instructions = format_instructions)
|
86 |
mock_skill_pri = chat_0_4(prompt_skill)
|
87 |
+
#print(mock_skill_pri)
|
88 |
mock_skill_pri_fin = mock_skill_pri.content.split(',')
|
89 |
+
#print(mock_skill_pri_fin)
|
90 |
return mock_skill_pri_fin
|
91 |
|
92 |
|
|
|
94 |
def skill_sec_cr(skill_pri,language,key):
|
95 |
tar_skill_sec_prompt = """ Assume you are the recruiter, read the skill sets in {skill_pri}, list 5 related tech terms for each skill set you want to see on candidates resume in {lang}.\n{format_instructions}
|
96 |
"""
|
97 |
+
chat_0_4 = ChatOpenAI(temperature = 0.0,model_name = 'gpt-4',openai_api_key = key)
|
98 |
+
#chat_0_3 = ChatOpenAI(temperature = 0.0,openai_api_key = key)
|
99 |
pTem_tar_skill_sec = ChatPromptTemplate.from_template(tar_skill_sec_prompt)
|
100 |
prompt_skill_sec = pTem_tar_skill_sec.format_messages(skill_pri = skill_pri,lang = language,format_instructions = format_instructions)
|
101 |
|
102 |
+
#mock_skill_sec = chat_0_3(prompt_skill_sec)
|
103 |
+
mock_skill_sec = chat_0_4(prompt_skill_sec)
|
104 |
+
#print(mock_skill_sec)
|
105 |
mock_skill_sec_fin = mock_skill_sec.content.split(',')
|
106 |
+
#print(mock_skill_sec_fin)
|
107 |
return mock_skill_sec_fin
|
108 |
|
109 |
#社团生成函数
|
|
|
115 |
prompt_soc = pTem_tar_soc.format_messages(job_name = target_job,lang = language,format_instructions = format_instructions)
|
116 |
|
117 |
mock_exp_soc = chat_0_4(prompt_soc)
|
118 |
+
#print(mock_exp_soc)
|
119 |
mock_exp_soc_fin = mock_exp_soc.content.split(',')
|
120 |
+
#print(mock_exp_soc_fin)
|
121 |
|
122 |
return mock_exp_soc_fin
|
123 |
|
|
|
132 |
|
133 |
|
134 |
mock_working_exp = chat_0_4(prompt_working_exp)
|
135 |
+
#print(mock_working_exp)
|
136 |
mock_working_exp_fin = r_splitter.split_text(mock_working_exp.content)
|
137 |
+
#print(mock_working_exp_fin)
|
138 |
result = [mock_working_exp_fin[0],mock_working_exp_fin[1],mock_working_exp_fin[2]]
|
139 |
|
140 |
|
141 |
+
#print(mock_working_exp_fin[3])
|
142 |
+
#print(result)
|
143 |
return (mock_working_exp_fin[0],mock_working_exp_fin[1],mock_working_exp_fin[2])
|
144 |
|
145 |
|
|
|
148 |
chat_0_4 = ChatOpenAI(temperature = 0.0,model_name = 'gpt-4',openai_api_key = key)
|
149 |
#n_range = range(0,80)
|
150 |
#rand_value = random.sample(n_range,4)
|
151 |
+
#print(rand_value)
|
152 |
|
153 |
mock_skill_soc_fin = np.array(mock_skill_soc)[rand_value]
|
154 |
|
155 |
pTem_tar_club_exp = ChatPromptTemplate.from_template(club_exp_prompt)
|
156 |
prompt_club_exp = pTem_tar_club_exp.format_messages(club = mock_soc,lang = language,skill_sec_club = mock_skill_soc_fin)
|
157 |
|
158 |
+
#print(pTem_tar_club_exp)
|
159 |
+
#print(prompt_club_exp)
|
160 |
|
161 |
|
162 |
mock_club_exp = chat_0_4(prompt_club_exp)
|
163 |
+
#print(mock_club_exp)
|
164 |
|
165 |
mock_club_exp_fin = r_splitter.split_text(mock_club_exp.content)
|
166 |
+
#print(mock_club_exp_fin)
|
167 |
|
168 |
+
#print(mock_club_exp_fin[0])
|
169 |
|
170 |
return mock_club_exp_fin
|
171 |
|
|
|
183 |
|
184 |
|
185 |
return mock_skill_sec
|
186 |
+
#简历展示函数
|
187 |
+
def resume_header(name,mobile,email,Gra_beg,Gra_end,Gra_sch,Gra_maj,underGra_beg,underGra_end,underGra_sch,underGra_maj):
|
188 |
+
header = f"""
|
189 |
+
<main role="main">
|
190 |
+
<div class="page"><!-- 1. Header -->
|
191 |
+
<h1 style="text-align: center;">{name}</h1>
|
192 |
+
<p style="text-align: center;">Mobile:{mobile} Email:{email}</p>
|
193 |
+
<hr /><!-- 2a. Resume Content -->
|
194 |
+
<section class="resume_content">
|
195 |
+
<article>
|
196 |
+
<h3>Education Background</h3>
|
197 |
+
<div style="float: left;">{Gra_beg}-{Gra_end} <strong>{Gra_sch}</strong></div>
|
198 |
+
<div style="float: right;">{Gra_maj} <strong>Master</strong></div>
|
199 |
+
<br />
|
200 |
+
<div style="float: left;">{underGra_beg}-{underGra_end} <strong>{underGra_sch}</strong></div>
|
201 |
+
<div style="float: right;">{underGra_maj} <strong>Bachelor</strong></div>
|
202 |
+
<br /><hr />
|
203 |
+
<h3>Working Experience</h3>
|
204 |
+
</article>
|
205 |
+
</section>
|
206 |
+
</div>
|
207 |
+
</main>
|
208 |
+
|
209 |
+
"""
|
210 |
+
return header
|
211 |
|
212 |
+
def resume_working_exp(exp_beg,exp_end,exp_com,exp_title,exp_1,exp_2,exp_3):
|
213 |
+
working_exp = f"""
|
214 |
+
<main role="main">
|
215 |
+
<div class="page">
|
216 |
+
<section>
|
217 |
+
<div style="float: left;">{exp_beg}-{exp_end} <strong>{exp_com}</strong></div>
|
218 |
+
<div style="float: right;"><strong>{exp_title}</strong></div>
|
219 |
+
<br />
|
220 |
+
<ul>
|
221 |
+
<p><li>{exp_1}</li></p>
|
222 |
+
<p><li>{exp_2}</li></p>
|
223 |
+
<p><li>{exp_3}</li></p>
|
224 |
+
</ul>
|
225 |
+
</section>
|
226 |
+
</div>
|
227 |
+
</main>
|
228 |
+
|
229 |
+
"""
|
230 |
+
return working_exp
|
231 |
|
232 |
|
233 |
|
234 |
#简历排版函数
|
235 |
+
def resume(name,mobile,email,Gra_beg,Gra_end,Gra_sch,Gra_maj,underGra_beg,underGra_end,underGra_sch,underGra_maj,exp_one_beg,exp_one_end,exp_one_com,exp_one_title,exp_one_1,exp_one_2,exp_one_3,exp_two_beg,exp_two_end,exp_two_com,exp_two_title,exp_two_1,exp_two_2,exp_two_3,exp_three_beg,exp_three_end,exp_three_com,exp_three_title,exp_three_1,exp_three_2,exp_three_3,exp_four_beg,exp_four_end,exp_four_com,exp_four_title,exp_four_1,exp_four_2,exp_four_3):
|
236 |
|
237 |
# 生成html和pdf
|
238 |
|
|
|
242 |
<main role="main">
|
243 |
<div class="page"><!-- 1. Header -->
|
244 |
<h1 style="text-align: center;">{name}</h1>
|
245 |
+
<p style="text-align: center;">Mobile:{mobile} Email:{email}</p>
|
246 |
<hr /><!-- 2a. Resume Content -->
|
247 |
<section class="resume_content">
|
248 |
<article>
|
249 |
+
<h3>Education Background</h3>
|
250 |
<div style="float: left;">{Gra_beg}-{Gra_end} <strong>{Gra_sch}</strong></div>
|
251 |
+
<div style="float: right;">{Gra_maj} <strong>Master</strong></div>
|
252 |
<br />
|
253 |
<div style="float: left;">{underGra_beg}-{underGra_end} <strong>{underGra_sch}</strong></div>
|
254 |
+
<div style="float: right;">{underGra_maj} <strong>Bachelor</strong></div>
|
255 |
<br /><hr />
|
256 |
+
<h3>Working Experience</h3>
|
257 |
<section>
|
258 |
<div style="float: left;">{exp_one_beg}-{exp_one_end} <strong>{exp_one_com}</strong></div>
|
259 |
<div style="float: right;"><strong>{exp_one_title}</strong></div>
|
|
|
279 |
<p><li>{exp_three_2}</li></p>
|
280 |
<p><li>{exp_three_3}</li></p>
|
281 |
</ul>
|
282 |
+
<div style="float: left;">{exp_four_beg}-{exp_four_end} <strong>{exp_four_com}</strong></div>
|
283 |
+
<div style="float: right;"><strong>{exp_four_title}</strong></div>
|
284 |
+
<br />
|
285 |
+
<ul>
|
286 |
+
<p><li>{exp_four_1}</li></p>
|
287 |
+
<p><li>{exp_four_2}</li></p>
|
288 |
+
<p><li>{exp_four_3}</li></p>
|
289 |
+
</ul>
|
290 |
</article>
|
291 |
</section>
|
292 |
</div>
|
|
|
296 |
"""
|
297 |
|
298 |
|
299 |
+
pdfkit.from_string(body, "Resume.pdf",options=pdfkit_options) #with --page-size=Legal and --orientation=Landscape
|
300 |
|
301 |
|
302 |
|
303 |
+
return "Resume.pdf"
|
304 |
|
305 |
|
306 |
# In[ ]:
|
|
|
309 |
|
310 |
|
311 |
|
312 |
+
# In[59]:
|
313 |
|
314 |
|
315 |
# Json输入,Dropdown更新函数
|
|
|
339 |
#文本框提交输出文本值
|
340 |
def Textbox_value_os(str_in):
|
341 |
return gr.Textbox.update(value = str_in)
|
342 |
+
#触发其他Textbox的显示
|
343 |
+
def Textbox_visible():
|
344 |
+
return gr.Textbox.update(visible = True)
|
345 |
+
#触发Button的不可点击态
|
346 |
+
def Button_inact():
|
347 |
+
return gr.Button.update(interactive = False)
|
348 |
+
#恢复Button的可点击态
|
349 |
+
def Button_act():
|
350 |
+
return gr.Button.update(interactive = True)
|
351 |
|
352 |
|
353 |
|
|
|
360 |
#openai_gpt4_key = gr.Textbox(label="OpenAI GPT4 Key", value="", type="password", placeholder="sk..", info = "You have to provide your own GPT4 keys for this app to function properly",)
|
361 |
#key = str(txt_openAI_key.change(Textbox_value_submit, inputs =txt_openAI_key))
|
362 |
#print(key)
|
363 |
+
txt_key = gr.Textbox(type="password", placeholder="sk..",label = "Openai API key")
|
364 |
#print(openai_gpt4_key)
|
|
|
365 |
txt_tarcom_in = gr.Textbox(label = "Target Company",info = "e.g. Amazon")
|
366 |
txt_tarjob_in = gr.Textbox(label = "Target Job",info = "e.g. Data Analyst")
|
367 |
txt_jd_in = gr.Textbox(label = "Job Responsibility",info = "e.g. - Write high quality distributed system software- Build production quality and large scale deployment of applications related to NLP and ML- Use software engineering best practices to ensure a high standard of quality for all team deliverables- Design, implement, test, deploy and maintain innovative software solutions to transform service performance, stability, cost and security- Help drive business decisions with your technical input- Work in an agile, startup-like development environment, where you're always working on the most important stuff")
|
368 |
+
txt_lang_in = gr.Dropdown(["English"],label="Language", info="Choose the language of your resume")
|
369 |
btn_resume_info = gr.Button(value="Analyze Target Job")
|
370 |
+
|
371 |
+
|
372 |
+
#btn_resume_pre = gr.Button(value = "Preview Resume",visible = False)
|
373 |
+
js_com_out = gr.JSON(label = "Company output",visible = False)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
374 |
js_title_out = gr.JSON(label = "Proper Title",visible = False)
|
375 |
js_sec_skill_out = gr.JSON(label = "Output",visible = False)
|
376 |
js_club_out = gr.JSON(label = "Output",visible = False)
|
377 |
#dd_com_in = gr.Dropdown(options)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
378 |
|
379 |
+
|
380 |
+
notice = gr.Label("Please wait until resume is shown on the right side (around 90s). Try to fill in bio below in this time.",visible = False)
|
381 |
+
with gr.Row():
|
382 |
+
name = gr.Textbox(label = "Name",visible = False)
|
383 |
+
mobile = gr.Textbox(label = "Mobile",visible = False)
|
384 |
+
email = gr.Textbox(label = "Email",visible = False)
|
385 |
+
with gr.Row():
|
386 |
+
Gra_beg = gr.Textbox(label = "Graduate School Beginning Year",visible = False)
|
387 |
+
Gra_end = gr.Textbox(label = "Graduate School End Year",visible = False)
|
388 |
+
Gra_sch = gr.Textbox(label = "Graduate School Name",visible = False)
|
389 |
+
Gra_maj = gr.Textbox(label = "Graduate School Major",visible = False)
|
390 |
+
with gr.Row():
|
391 |
+
underGra_beg = gr.Textbox(label = "Undergraduate School Beginning Year",visible = False)
|
392 |
+
underGra_end = gr.Textbox(label = "Undergraduate School End Year",visible = False)
|
393 |
+
underGra_sch = gr.Textbox(label = "Undergraduate School Name",visible = False)
|
394 |
+
underGra_maj = gr.Textbox(label = "Undergraduate School Major",visible = False)
|
395 |
|
396 |
+
btn_exp_gen = gr.Button(value = "Add Your Headers",visible = False)
|
397 |
|
398 |
|
399 |
with gr.Row():
|
400 |
+
exp_com_one = gr.Textbox(value = options,label="Company Name",visible = False)
|
401 |
+
exp_title_one = gr.Textbox(value = options,label="Title Name",visible = False)
|
402 |
+
time_beg_one = gr.Textbox(value = '2016',label = "Beginning years",visible = False)
|
403 |
+
time_end_one = gr.Textbox(value = '2017',label = "Ending years",visible = False)
|
404 |
exp_skill_one = gr.Dropdown(value = options, label = "Skill",multiselect = True,visible = False)
|
405 |
+
|
406 |
+
|
407 |
+
|
408 |
+
|
|
|
|
|
|
|
409 |
|
410 |
|
411 |
+
|
412 |
+
exp_txt_one_1 = gr.Textbox(value = options,interactive = True,visible = False)
|
413 |
+
exp_txt_one_1_out = gr.Textbox(value = options,interactive = True,visible = False,label = "Working Experience")
|
414 |
+
exp_txt_one_2 = gr.Textbox(value = options,interactive = True,visible = False)
|
415 |
+
exp_txt_one_2_out = gr.Textbox(value = options,interactive = True,visible = False,label = "Working Experience")
|
416 |
+
exp_txt_one_3 = gr.Textbox(value = options,interactive = True,visible = False)
|
417 |
+
exp_txt_one_3_out = gr.Textbox(value = options,interactive = True,visible = False,label = "Working Experience")
|
418 |
btn_work_exp_one = gr.Button(value = "Update Working Experience One",visible = False)
|
419 |
|
420 |
+
|
421 |
+
|
422 |
|
423 |
|
424 |
|
425 |
with gr.Row():
|
426 |
+
exp_com_two = gr.Textbox(value = options,label="Company Name",visible = False)
|
427 |
+
exp_title_two = gr.Textbox(value = options,label="Title Name",visible = False)
|
428 |
+
time_beg_two = gr.Textbox(value = '2016',label = "Beginning years",visible = False)
|
429 |
+
time_end_two = gr.Textbox(value = '2017',label = "Ending years",visible = False)
|
430 |
exp_skill_two = gr.Dropdown(value = options, label = "Skill",multiselect = True,visible = False)
|
|
|
|
|
|
|
431 |
|
432 |
+
|
433 |
+
|
434 |
+
exp_txt_two_1 = gr.Textbox(value = options,interactive = True,visible = False)
|
435 |
+
exp_txt_two_1_out = gr.Textbox(value = options,interactive = True,visible = False,label = "Working Experience")
|
436 |
+
exp_txt_two_2 = gr.Textbox(value = options,interactive = True,visible = False)
|
437 |
+
exp_txt_two_2_out = gr.Textbox(value = options,interactive = True,visible = False,label = "Working Experience")
|
438 |
+
exp_txt_two_3 = gr.Textbox(value = options,interactive = True,visible = False)
|
439 |
+
exp_txt_two_3_out = gr.Textbox(value = options,interactive = True,visible = False,label = "Working Experience")
|
440 |
btn_work_exp_two = gr.Button(value = "Update Working Experience Two",visible = False)
|
441 |
|
442 |
+
|
443 |
+
|
444 |
|
445 |
|
446 |
|
447 |
|
448 |
|
449 |
with gr.Row():
|
450 |
+
exp_com_three = gr.Textbox(value = options,label="Company Name",visible = False)
|
451 |
+
exp_title_three = gr.Textbox(value = options,label="Title Name",visible = False)
|
452 |
+
time_beg_three = gr.Textbox(value = '2016',label = "Beginning years",visible = False)
|
453 |
+
time_end_three = gr.Textbox(value = '2017',label = "Ending years",visible = False)
|
454 |
exp_skill_three = gr.Dropdown(value = options, label = "Skill",multiselect = True,visible = False)
|
|
|
|
|
|
|
455 |
|
456 |
+
|
457 |
+
|
458 |
+
|
459 |
+
exp_txt_three_1 = gr.Textbox(value = options,interactive = True,visible = False)
|
460 |
+
exp_txt_three_1_out = gr.Textbox(value = options,interactive = True,visible = False,label = "Working Experience")
|
461 |
+
exp_txt_three_2 = gr.Textbox(value = options,interactive = True,visible = False)
|
462 |
+
exp_txt_three_2_out = gr.Textbox(value = options,interactive = True,visible = False,label = "Working Experience")
|
463 |
+
exp_txt_three_3 = gr.Textbox(value = options,interactive = True,visible = False)
|
464 |
+
exp_txt_three_3_out = gr.Textbox(value = options,interactive = True,visible = False,label = "Working Experience")
|
465 |
btn_work_exp_three = gr.Button(value = "Update Working Experience Three",visible = False)
|
466 |
+
|
467 |
+
|
468 |
|
469 |
+
with gr.Row():
|
470 |
+
exp_com_four = gr.Textbox(value = options,label="Company Name",visible = False)
|
471 |
+
exp_title_four = gr.Textbox(value = options,label="Title Name",visible = False)
|
472 |
+
time_beg_four = gr.Textbox(value = '2016',label = "Beginning years",visible = False)
|
473 |
+
time_end_four = gr.Textbox(value = '2017',label = "Ending years",visible = False)
|
474 |
+
exp_skill_four = gr.Dropdown(value = options, label = "Skill",multiselect = True,visible = False)
|
475 |
|
476 |
+
|
477 |
+
|
478 |
|
479 |
+
exp_txt_four_1 = gr.Textbox(value = options,interactive = True,visible = False)
|
480 |
+
exp_txt_four_1_out = gr.Textbox(value = options,interactive = True,visible = False,label = "Working Experience")
|
481 |
+
exp_txt_four_2 = gr.Textbox(value = options,interactive = True,visible = False)
|
482 |
+
exp_txt_four_2_out = gr.Textbox(value = options,interactive = True,visible = False,label = "Working Experience")
|
483 |
+
exp_txt_four_3 = gr.Textbox(value = options,interactive = True,visible = False)
|
484 |
+
exp_txt_four_3_out = gr.Textbox(value = options,interactive = True,visible = False,label = "Working Experience")
|
485 |
+
btn_work_exp_four = gr.Button(value = "Update Working Experience four",visible = False)
|
486 |
+
|
487 |
|
488 |
+
|
489 |
+
|
490 |
+
with gr.Column():
|
491 |
+
webpage_1 = gr.HTML()
|
492 |
+
webpage_2 = gr.HTML()
|
493 |
+
webpage_3 = gr.HTML()
|
494 |
+
webpage_4 = gr.HTML()
|
495 |
+
webpage_5 = gr.HTML()
|
496 |
+
donate = gr.Markdown("As a product manager, it's my first time developing a project by my self, so the coding quality is really poor.\n Please give your feedbacks so I can keep updating this project.\n Really appreciated for donating to the project if you like it.\n https://donate.stripe.com/7sI29DemibwjgkU4gg")
|
497 |
+
btn_resume_download = gr.Button(value = "Download Resume and Donate the Project",visible = False)
|
498 |
+
resume_file = gr.File()
|
499 |
+
|
500 |
|
501 |
+
|
502 |
+
# Backend
|
503 |
+
|
504 |
+
num_one = gr.Textbox("0",visible = False)
|
505 |
+
num_two = gr.Textbox("1",visible = False)
|
506 |
+
num_three = gr.Textbox("2",visible = False)
|
507 |
+
num_four = gr.Textbox("3",visible = False)
|
508 |
+
num_rand = gr.Textbox("10",visible = False)
|
509 |
+
|
510 |
+
txt_key.change(Textbox_value_os,inputs = txt_key)
|
511 |
+
btn_resume_info.click(Button_inact,outputs = btn_resume_info)
|
512 |
+
btn_resume_info.click(company_cr, inputs = [txt_tarcom_in, txt_lang_in, txt_key], outputs = js_com_out)
|
513 |
+
btn_resume_info.click(job_cr, inputs = [txt_tarjob_in, txt_lang_in,txt_key], outputs = js_title_out)
|
514 |
+
btn_resume_info.click(skill_info, inputs = [txt_jd_in, txt_lang_in,txt_key], outputs = js_sec_skill_out)
|
515 |
+
|
516 |
+
|
517 |
+
btn_resume_info.click(Textbox_visible,outputs = notice)
|
518 |
+
btn_resume_info.click(Textbox_visible,outputs = name)
|
519 |
+
btn_resume_info.click(Textbox_visible,outputs = mobile)
|
520 |
+
btn_resume_info.click(Textbox_visible,outputs = email)
|
521 |
+
btn_resume_info.click(Textbox_visible,outputs = Gra_beg)
|
522 |
+
btn_resume_info.click(Textbox_visible,outputs = Gra_end)
|
523 |
+
btn_resume_info.click(Textbox_visible,outputs = Gra_sch)
|
524 |
+
btn_resume_info.click(Textbox_visible,outputs = Gra_maj)
|
525 |
+
btn_resume_info.click(Textbox_visible,outputs = underGra_beg)
|
526 |
+
btn_resume_info.click(Textbox_visible,outputs = underGra_end)
|
527 |
+
btn_resume_info.click(Textbox_visible,outputs = underGra_sch)
|
528 |
+
btn_resume_info.click(Textbox_visible,outputs = underGra_maj)
|
529 |
+
|
530 |
+
|
531 |
+
btn_resume_info.click(Button_visible,outputs = btn_exp_gen)
|
532 |
+
|
533 |
+
|
534 |
+
|
535 |
+
|
536 |
+
|
537 |
+
btn_exp_gen.click(resume_header,inputs=[name,mobile,email,Gra_beg,Gra_end,Gra_sch,Gra_maj,underGra_beg,underGra_end,underGra_sch,underGra_maj],outputs = webpage_1)
|
538 |
+
|
539 |
+
|
540 |
+
|
541 |
+
|
542 |
+
|
543 |
+
|
544 |
+
|
545 |
+
|
546 |
+
|
547 |
+
#btn_resume_info.click(Button_visible,outputs = btn_exp_gen,queue = True)
|
548 |
+
|
549 |
+
|
550 |
+
#btn_exp_gen.click(Textbox_value,inputs = [js_com_out,num_one],outputs = exp_com_one)
|
551 |
+
#btn_exp_gen.click(Textbox_value,inputs = [js_title_out,num_one],outputs = exp_title_one)
|
552 |
+
#btn_exp_gen.click(Dropdown_value_rand,inputs = [js_sec_skill_out,num_rand],outputs = exp_skill_one)
|
553 |
+
js_com_out.change(Textbox_value,inputs = [js_com_out,num_one],outputs = exp_com_one)
|
554 |
+
js_title_out.change(Textbox_value,inputs = [js_title_out,num_one],outputs = exp_title_one)
|
555 |
+
js_sec_skill_out.change(Dropdown_value_rand,inputs = [js_sec_skill_out,num_rand],outputs = exp_skill_one)
|
556 |
+
|
557 |
+
#js_com_out = gr.JSON(label = "Company output")
|
558 |
+
#js_title_out = gr.JSON(label = "Proper Title",visible = False)
|
559 |
+
#js_sec_skill_out = gr.JSON(label = "Output",visible = False)
|
560 |
+
#js_club_out = gr.JSON(label = "Output",visible = False)
|
561 |
+
|
562 |
+
|
563 |
+
exp_skill_one.change(work_exp, inputs=[exp_com_one,exp_title_one,exp_skill_one,txt_lang_in,txt_key],outputs = [exp_txt_one_1,exp_txt_one_2,exp_txt_one_3])
|
564 |
+
|
565 |
+
exp_txt_one_1.change(resume_working_exp,inputs=[time_beg_one,time_end_one,exp_com_one,exp_title_one,exp_txt_one_1,exp_txt_one_2,exp_txt_one_3],outputs = webpage_2)
|
566 |
+
|
567 |
+
exp_txt_one_1.change(Textbox_value_os,exp_txt_one_1,outputs = exp_txt_one_1_out)
|
568 |
+
exp_txt_one_2.change(Textbox_value_os,exp_txt_one_2,outputs = exp_txt_one_2_out)
|
569 |
+
exp_txt_one_3.change(Textbox_value_os,exp_txt_one_3,outputs = exp_txt_one_3_out)
|
570 |
+
|
571 |
+
|
572 |
+
|
573 |
+
|
574 |
+
|
575 |
+
|
576 |
+
exp_txt_one_1.change(Textbox_visible,outputs = exp_txt_one_1_out)
|
577 |
+
exp_txt_one_2.change(Textbox_visible,outputs = exp_txt_one_2_out)
|
578 |
+
exp_txt_one_3.change(Textbox_visible,outputs = exp_txt_one_3_out)
|
579 |
+
exp_txt_one_1.change(Textbox_visible,outputs = exp_com_one)
|
580 |
+
exp_txt_one_1.change(Textbox_visible,outputs = exp_title_one)
|
581 |
+
exp_txt_one_1.change(Textbox_visible,outputs = time_beg_one)
|
582 |
+
exp_txt_one_1.change(Textbox_visible,outputs = time_end_one)
|
583 |
+
|
584 |
+
|
585 |
+
|
586 |
+
|
587 |
+
exp_txt_one_1_out.submit(resume_working_exp,inputs=[time_beg_one,time_end_one,exp_com_one,exp_title_one,exp_txt_one_1_out,exp_txt_one_2_out,exp_txt_one_3_out],outputs = webpage_2)
|
588 |
+
exp_txt_one_2_out.submit(resume_working_exp,inputs=[time_beg_one,time_end_one,exp_com_one,exp_title_one,exp_txt_one_1_out,exp_txt_one_2_out,exp_txt_one_3_out],outputs = webpage_2)
|
589 |
+
exp_txt_one_3_out.submit(resume_working_exp,inputs=[time_beg_one,time_end_one,exp_com_one,exp_title_one,exp_txt_one_1_out,exp_txt_one_2_out,exp_txt_one_3_out],outputs = webpage_2)
|
590 |
+
|
591 |
+
|
592 |
+
time_beg_one.submit(resume_working_exp,inputs=[time_beg_one,time_end_one,exp_com_one,exp_title_one,exp_txt_one_1_out,exp_txt_one_2_out,exp_txt_one_3_out],outputs = webpage_2)
|
593 |
+
time_end_one.submit(resume_working_exp,inputs=[time_beg_one,time_end_one,exp_com_one,exp_title_one,exp_txt_one_1_out,exp_txt_one_2_out,exp_txt_one_3_out],outputs = webpage_2)
|
594 |
+
exp_com_one.submit(resume_working_exp,inputs=[time_beg_one,time_end_one,exp_com_one,exp_title_one,exp_txt_one_1_out,exp_txt_one_2_out,exp_txt_one_3_out],outputs = webpage_2)
|
595 |
+
exp_title_one.submit(resume_working_exp,inputs=[time_beg_one,time_end_one,exp_com_one,exp_title_one,exp_txt_one_1_out,exp_txt_one_2_out,exp_txt_one_3_out],outputs = webpage_2)
|
596 |
+
|
597 |
+
|
598 |
+
|
599 |
+
js_com_out.change(Textbox_value,inputs = [js_com_out,num_two],outputs = exp_com_two)
|
600 |
+
js_title_out.change(Textbox_value,inputs = [js_title_out,num_two],outputs = exp_title_two)
|
601 |
+
js_sec_skill_out.change(Dropdown_value_rand,inputs = [js_sec_skill_out,num_rand],outputs = exp_skill_two)
|
602 |
+
|
603 |
+
|
604 |
+
|
605 |
+
exp_txt_one_1.change(work_exp, inputs=[exp_com_two,exp_title_two,exp_skill_two,txt_lang_in,txt_key],outputs = [exp_txt_two_1,exp_txt_two_2,exp_txt_two_3])
|
606 |
+
|
607 |
+
exp_txt_two_1.change(resume_working_exp,inputs=[time_beg_two,time_end_two,exp_com_two,exp_title_two,exp_txt_two_1,exp_txt_two_2,exp_txt_two_3],outputs = webpage_3)
|
608 |
+
|
609 |
+
exp_txt_two_1.change(Textbox_value_os,exp_txt_two_1,outputs = exp_txt_two_1_out)
|
610 |
+
exp_txt_two_2.change(Textbox_value_os,exp_txt_two_2,outputs = exp_txt_two_2_out)
|
611 |
+
exp_txt_two_3.change(Textbox_value_os,exp_txt_two_3,outputs = exp_txt_two_3_out)
|
612 |
+
|
613 |
+
exp_txt_two_1.change(Textbox_visible,outputs = exp_txt_two_1_out)
|
614 |
+
exp_txt_two_2.change(Textbox_visible,outputs = exp_txt_two_2_out)
|
615 |
+
exp_txt_two_3.change(Textbox_visible,outputs = exp_txt_two_3_out)
|
616 |
+
exp_txt_two_1.change(Textbox_visible,outputs = exp_com_two)
|
617 |
+
exp_txt_two_1.change(Textbox_visible,outputs = exp_title_two)
|
618 |
+
exp_txt_two_1.change(Textbox_visible,outputs = time_beg_two)
|
619 |
+
exp_txt_two_1.change(Textbox_visible,outputs = time_end_two)
|
620 |
+
|
621 |
+
|
622 |
+
|
623 |
+
exp_txt_two_1_out.submit(resume_working_exp,inputs=[time_beg_two,time_end_two,exp_com_two,exp_title_two,exp_txt_two_1_out,exp_txt_two_2_out,exp_txt_two_3_out],outputs = webpage_3)
|
624 |
+
exp_txt_two_2_out.submit(resume_working_exp,inputs=[time_beg_two,time_end_two,exp_com_two,exp_title_two,exp_txt_two_1_out,exp_txt_two_2_out,exp_txt_two_3_out],outputs = webpage_3)
|
625 |
+
exp_txt_two_3_out.submit(resume_working_exp,inputs=[time_beg_two,time_end_two,exp_com_two,exp_title_two,exp_txt_two_1_out,exp_txt_two_2_out,exp_txt_two_3_out],outputs = webpage_3)
|
626 |
+
|
627 |
+
time_beg_two.submit(resume_working_exp,inputs=[time_beg_two,time_end_two,exp_com_two,exp_title_two,exp_txt_two_1_out,exp_txt_two_2_out,exp_txt_two_3_out],outputs = webpage_3)
|
628 |
+
time_end_two.submit(resume_working_exp,inputs=[time_beg_two,time_end_two,exp_com_two,exp_title_two,exp_txt_two_1_out,exp_txt_two_2_out,exp_txt_two_3_out],outputs = webpage_3)
|
629 |
+
exp_com_two.submit(resume_working_exp,inputs=[time_beg_two,time_end_two,exp_com_two,exp_title_two,exp_txt_two_1_out,exp_txt_two_2_out,exp_txt_two_3_out],outputs = webpage_3)
|
630 |
+
exp_title_two.submit(resume_working_exp,inputs=[time_beg_two,time_end_two,exp_com_two,exp_title_two,exp_txt_two_1_out,exp_txt_two_2_out,exp_txt_two_3_out],outputs = webpage_3)
|
631 |
+
|
632 |
+
|
633 |
+
|
634 |
+
|
635 |
+
js_com_out.change(Textbox_value,inputs = [js_com_out,num_three],outputs = exp_com_three)
|
636 |
+
js_title_out.change(Textbox_value,inputs = [js_title_out,num_one],outputs = exp_title_three)
|
637 |
+
js_sec_skill_out.change(Dropdown_value_rand,inputs = [js_sec_skill_out,num_rand],outputs = exp_skill_three)
|
638 |
+
|
639 |
+
|
640 |
+
|
641 |
+
exp_txt_two_1.change(work_exp, inputs=[exp_com_three,exp_title_three,exp_skill_three,txt_lang_in,txt_key],outputs = [exp_txt_three_1,exp_txt_three_2,exp_txt_three_3])
|
642 |
+
exp_txt_three_1.change(resume_working_exp,inputs=[time_beg_three,time_end_three,exp_com_three,exp_title_three,exp_txt_three_1,exp_txt_three_2,exp_txt_three_3],outputs = webpage_4)
|
643 |
+
|
644 |
+
exp_txt_three_1.change(Textbox_value_os,exp_txt_three_1,outputs = exp_txt_three_1_out)
|
645 |
+
exp_txt_three_2.change(Textbox_value_os,exp_txt_three_2,outputs = exp_txt_three_2_out)
|
646 |
+
exp_txt_three_3.change(Textbox_value_os,exp_txt_three_3,outputs = exp_txt_three_3_out)
|
647 |
+
|
648 |
+
exp_txt_three_1.change(Textbox_visible,outputs = exp_txt_three_1_out)
|
649 |
+
exp_txt_three_2.change(Textbox_visible,outputs = exp_txt_three_2_out)
|
650 |
+
exp_txt_three_3.change(Textbox_visible,outputs = exp_txt_three_3_out)
|
651 |
+
exp_txt_three_1.change(Textbox_visible,outputs = exp_com_three)
|
652 |
+
exp_txt_three_1.change(Textbox_visible,outputs = exp_title_three)
|
653 |
+
exp_txt_three_1.change(Textbox_visible,outputs = time_beg_three)
|
654 |
+
exp_txt_three_1.change(Textbox_visible,outputs = time_end_three)
|
655 |
+
|
656 |
+
exp_txt_three_1_out.submit(resume_working_exp,inputs=[time_beg_three,time_end_three,exp_com_three,exp_title_three,exp_txt_three_1_out,exp_txt_three_2_out,exp_txt_three_3_out],outputs = webpage_4)
|
657 |
+
exp_txt_three_2_out.submit(resume_working_exp,inputs=[time_beg_three,time_end_three,exp_com_three,exp_title_three,exp_txt_three_1_out,exp_txt_three_2_out,exp_txt_three_3_out],outputs = webpage_4)
|
658 |
+
exp_txt_three_3_out.submit(resume_working_exp,inputs=[time_beg_three,time_end_three,exp_com_three,exp_title_three,exp_txt_three_1_out,exp_txt_three_2_out,exp_txt_three_3_out],outputs = webpage_4)
|
659 |
+
|
660 |
+
time_beg_three.submit(resume_working_exp,inputs=[time_beg_three,time_end_three,exp_com_three,exp_title_three,exp_txt_three_1_out,exp_txt_three_2_out,exp_txt_three_3_out],outputs = webpage_4)
|
661 |
+
time_end_three.submit(resume_working_exp,inputs=[time_beg_three,time_end_three,exp_com_three,exp_title_three,exp_txt_three_1_out,exp_txt_three_2_out,exp_txt_three_3_out],outputs = webpage_4)
|
662 |
+
exp_com_three.submit(resume_working_exp,inputs=[time_beg_three,time_end_three,exp_com_three,exp_title_three,exp_txt_three_1_out,exp_txt_three_2_out,exp_txt_three_3_out],outputs = webpage_4)
|
663 |
+
exp_title_three.submit(resume_working_exp,inputs=[time_beg_three,time_end_three,exp_com_three,exp_title_three,exp_txt_three_1_out,exp_txt_three_2_out,exp_txt_three_3_out],outputs = webpage_4)
|
664 |
+
|
665 |
+
|
666 |
+
|
667 |
+
|
668 |
+
|
669 |
+
|
670 |
+
|
671 |
+
js_com_out.change(Textbox_value,inputs = [js_com_out,num_four],outputs = exp_com_four)
|
672 |
+
js_title_out.change(Textbox_value,inputs = [js_title_out,num_one],outputs = exp_title_four)
|
673 |
+
js_sec_skill_out.change(Dropdown_value_rand,inputs = [js_sec_skill_out,num_rand],outputs = exp_skill_four)
|
674 |
+
|
675 |
+
|
676 |
+
|
677 |
+
exp_txt_three_1.change(work_exp, inputs=[exp_com_four,exp_title_four,exp_skill_four,txt_lang_in,txt_key],outputs = [exp_txt_four_1,exp_txt_four_2,exp_txt_four_3])
|
678 |
+
exp_txt_four_1.change(resume_working_exp,inputs=[time_beg_four,time_end_four,exp_com_four,exp_title_four,exp_txt_four_1,exp_txt_four_2,exp_txt_four_3],outputs = webpage_5)
|
679 |
+
|
680 |
+
exp_txt_four_1.change(Textbox_value_os,exp_txt_four_1,outputs = exp_txt_four_1_out)
|
681 |
+
exp_txt_four_2.change(Textbox_value_os,exp_txt_four_2,outputs = exp_txt_four_2_out)
|
682 |
+
exp_txt_four_3.change(Textbox_value_os,exp_txt_four_3,outputs = exp_txt_four_3_out)
|
683 |
+
|
684 |
+
exp_txt_four_1.change(Textbox_visible,outputs = exp_txt_four_1_out)
|
685 |
+
exp_txt_four_2.change(Textbox_visible,outputs = exp_txt_four_2_out)
|
686 |
+
exp_txt_four_3.change(Textbox_visible,outputs = exp_txt_four_3_out)
|
687 |
+
exp_txt_four_1.change(Textbox_visible,outputs = exp_com_four)
|
688 |
+
exp_txt_four_1.change(Textbox_visible,outputs = exp_title_four)
|
689 |
+
exp_txt_four_1.change(Textbox_visible,outputs = time_beg_four)
|
690 |
+
exp_txt_four_1.change(Textbox_visible,outputs = time_end_four)
|
691 |
+
|
692 |
+
exp_txt_four_1_out.submit(resume_working_exp,inputs=[time_beg_four,time_end_four,exp_com_four,exp_title_four,exp_txt_four_1_out,exp_txt_four_2_out,exp_txt_four_3_out],outputs = webpage_5)
|
693 |
+
exp_txt_four_2_out.submit(resume_working_exp,inputs=[time_beg_four,time_end_four,exp_com_four,exp_title_four,exp_txt_four_1_out,exp_txt_four_2_out,exp_txt_four_3_out],outputs = webpage_5)
|
694 |
+
exp_txt_four_3_out.submit(resume_working_exp,inputs=[time_beg_four,time_end_four,exp_com_four,exp_title_four,exp_txt_four_1_out,exp_txt_four_2_out,exp_txt_four_3_out],outputs = webpage_5)
|
695 |
+
|
696 |
+
time_beg_four.submit(resume_working_exp,inputs=[time_beg_four,time_end_four,exp_com_four,exp_title_four,exp_txt_four_1_out,exp_txt_four_2_out,exp_txt_four_3_out],outputs = webpage_5)
|
697 |
+
time_end_four.submit(resume_working_exp,inputs=[time_beg_four,time_end_four,exp_com_four,exp_title_four,exp_txt_four_1_out,exp_txt_four_2_out,exp_txt_four_3_out],outputs = webpage_5)
|
698 |
+
exp_com_four.submit(resume_working_exp,inputs=[time_beg_four,time_end_four,exp_com_four,exp_title_four,exp_txt_four_1_out,exp_txt_four_2_out,exp_txt_four_3_out],outputs = webpage_5)
|
699 |
+
exp_title_four.submit(resume_working_exp,inputs=[time_beg_four,time_end_four,exp_com_four,exp_title_four,exp_txt_four_1_out,exp_txt_four_2_out,exp_txt_four_3_out],outputs = webpage_5)
|
700 |
+
|
701 |
+
|
702 |
+
|
703 |
+
|
704 |
+
#btn_exp_gen.click(Button_visible,outputs = btn_resume_gen)
|
705 |
+
|
706 |
+
#btn_resume_gen.click(work_exp, inputs=[exp_com_one,exp_title_one,exp_skill_one,txt_lang_in,txt_key],outputs = [exp_txt_one_1,exp_txt_one_2,exp_txt_one_3])
|
707 |
+
#btn_resume_gen.click(work_exp, inputs=[exp_com_two,exp_title_two,exp_skill_two,txt_lang_in,txt_key],outputs = [exp_txt_two_1,exp_txt_two_2,exp_txt_two_3])
|
708 |
+
#btn_resume_gen.click(work_exp, inputs=[exp_com_three,exp_title_three,exp_skill_three,txt_lang_in,txt_key],outputs = [exp_txt_three_1,exp_txt_three_2,exp_txt_three_3])
|
709 |
+
#btn_resume_gen.click(Button_visible,outputs = btn_resume_pre)
|
710 |
+
|
711 |
+
|
712 |
+
|
713 |
+
exp_txt_three_1.change(Button_act,outputs = btn_resume_info)
|
714 |
+
btn_exp_gen.click(Button_visible,outputs = btn_resume_download)
|
715 |
+
|
716 |
+
|
717 |
+
#btn_resume_pre.click(resume_header,inputs=[name,mobile,email,Gra_beg,Gra_end,Gra_sch,Gra_maj,underGra_beg,underGra_end,underGra_sch,underGra_maj],outputs = webpage_1)
|
718 |
+
btn_resume_download.click(resume,inputs = [name,mobile,email,Gra_beg,Gra_end,Gra_sch,Gra_maj,underGra_beg,underGra_end,underGra_sch,underGra_maj,time_beg_one,time_end_one,exp_com_one,exp_title_one,exp_txt_one_1,exp_txt_one_2,exp_txt_one_3,time_beg_two,time_end_two,exp_com_two,exp_title_two,exp_txt_two_1,exp_txt_two_2,exp_txt_two_3,time_beg_three,time_end_three,exp_com_three,exp_title_three,exp_txt_three_1,exp_txt_three_2,exp_txt_three_3,time_beg_four,time_end_four,exp_com_four,exp_title_four,exp_txt_four_1,exp_txt_four_2,exp_txt_four_3],outputs = resume_file)
|
719 |
|
|
|
|
|
720 |
|
721 |
if __name__ == "__main__":
|
722 |
demo.launch(enable_queue = True)
|
requirements.txt
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
jinja2
|
2 |
openai
|
3 |
pdfkit
|
|
|
1 |
+
pdfkit
|
2 |
jinja2
|
3 |
openai
|
4 |
pdfkit
|