tengqf commited on
Commit
7f1f944
·
1 Parent(s): 1b174ca

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -10
app.py CHANGED
@@ -1,7 +1,7 @@
1
  #!/usr/bin/env python
2
  # coding: utf-8
3
 
4
- # In[35]:
5
 
6
 
7
  import os
@@ -25,12 +25,14 @@ from typing import List
25
  from langchain.text_splitter import CharacterTextSplitter,RecursiveCharacterTextSplitter
26
 
27
  output_parser = CommaSeparatedListOutputParser()
 
 
28
 
29
 
30
  from datetime import datetime
31
 
32
 
33
- # In[2]:
34
 
35
 
36
 
@@ -38,14 +40,14 @@ c_splitter = CharacterTextSplitter(chunk_size = 450,chunk_overlap = 0,separator
38
  r_splitter = RecursiveCharacterTextSplitter(chunk_size = 80,chunk_overlap = 0,separators = ["\n\n"])
39
 
40
 
41
- # In[3]:
42
 
43
 
44
  output_parser = CommaSeparatedListOutputParser()
45
  format_instructions = output_parser.get_format_instructions()
46
 
47
 
48
- # In[56]:
49
 
50
 
51
  #定义常用函数
@@ -296,7 +298,7 @@ def resume(name,mobile,email,Gra_beg,Gra_end,Gra_sch,Gra_maj,underGra_beg,underG
296
  """
297
 
298
 
299
- pdfkit.from_string(body, "Resume.pdf",options=pdfkit_options) #with --page-size=Legal and --orientation=Landscape
300
 
301
 
302
 
@@ -309,7 +311,7 @@ def resume(name,mobile,email,Gra_beg,Gra_end,Gra_sch,Gra_maj,underGra_beg,underG
309
 
310
 
311
 
312
- # In[59]:
313
 
314
 
315
  # Json输入,Dropdown更新函数
@@ -349,7 +351,6 @@ def Button_inact():
349
  def Button_act():
350
  return gr.Button.update(interactive = True)
351
 
352
-
353
 
354
 
355
  options = ['Select a company']
@@ -377,7 +378,7 @@ with gr.Blocks() as demo:
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)
@@ -493,9 +494,9 @@ with gr.Blocks() as demo:
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
 
 
1
  #!/usr/bin/env python
2
  # coding: utf-8
3
 
4
+ # In[60]:
5
 
6
 
7
  import os
 
25
  from langchain.text_splitter import CharacterTextSplitter,RecursiveCharacterTextSplitter
26
 
27
  output_parser = CommaSeparatedListOutputParser()
28
+ # Set the path to wkhtmltopdf executable file
29
+ #config = pdfkit.configuration(wkhtmltopdf='/home/user/.local/lib/python3.10/site-packages')
30
 
31
 
32
  from datetime import datetime
33
 
34
 
35
+ # In[61]:
36
 
37
 
38
 
 
40
  r_splitter = RecursiveCharacterTextSplitter(chunk_size = 80,chunk_overlap = 0,separators = ["\n\n"])
41
 
42
 
43
+ # In[62]:
44
 
45
 
46
  output_parser = CommaSeparatedListOutputParser()
47
  format_instructions = output_parser.get_format_instructions()
48
 
49
 
50
+ # In[63]:
51
 
52
 
53
  #定义常用函数
 
298
  """
299
 
300
 
301
+ pdfkit.from_string(body, "Resume.pdf",options=pdfkit_options,configuration = config) #with --page-size=Legal and --orientation=Landscape
302
 
303
 
304
 
 
311
 
312
 
313
 
314
+ # In[65]:
315
 
316
 
317
  # Json输入,Dropdown更新函数
 
351
  def Button_act():
352
  return gr.Button.update(interactive = True)
353
 
 
354
 
355
 
356
  options = ['Select a company']
 
378
  #dd_com_in = gr.Dropdown(options)
379
 
380
 
381
+ notice = gr.Label("Please wait until resume is shown on the right side (around 90s with 4 paragraphs). Try to fill in bio below in this time.",visible = False)
382
  with gr.Row():
383
  name = gr.Textbox(label = "Name",visible = False)
384
  mobile = gr.Textbox(label = "Mobile",visible = False)
 
494
  webpage_3 = gr.HTML()
495
  webpage_4 = gr.HTML()
496
  webpage_5 = gr.HTML()
497
+ donate = gr.Markdown("Enjoy and generate your first AI resume. Wish you get all best offers.\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")
498
  btn_resume_download = gr.Button(value = "Download Resume and Donate the Project",visible = False)
499
+ resume_file = gr.File(file_types = ["pdf"])
500
 
501
 
502