willn9 commited on
Commit
da4bb57
·
verified ·
1 Parent(s): 3e8d8ce

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +27 -21
app.py CHANGED
@@ -12,11 +12,12 @@ def respond(
12
  message,
13
  history: list[tuple[str, str]],
14
  system_message,
15
- segment_profile,
16
- value_proposition,
17
- promotion,
18
- subject,
19
- ask_for_subject_suggestions,
 
20
  max_tokens,
21
  temperature,
22
  top_p,
@@ -24,15 +25,16 @@ def respond(
24
  # Construct the system message with additional inputs
25
  enhanced_system_message = (
26
  f"{system_message}\n\n"
27
- f"Segment Profile: {segment_profile}\n"
28
- f"Value Proposition: {value_proposition}\n"
29
- f"Goal and Promotion: {promotion}\n"
30
- f"Subject Line: {subject}\n"
 
31
  )
32
 
33
  # If the user wants Subject Line suggestions, modify the prompt
34
- if ask_for_subject_suggestions:
35
- enhanced_system_message += "The user is also asking for subject line suggestion to catch their customer's attention and improve Email Open Rate."
36
 
37
  messages = [{"role": "system", "content": enhanced_system_message}]
38
 
@@ -65,20 +67,24 @@ demo = gr.ChatInterface(
65
  respond,
66
  additional_inputs=[
67
  gr.Textbox(
68
- value="You are a friendly Chatbot, a digital marketing expert and a talented copywriter. You are trying to help a user write a creative email that can achieve campaign goals, a high Open Rate, CTR and conversion rate - based on user input.",
69
  label="Instructions to Bot",
70
  ),
71
- gr.Textbox(label="Your Target Customer Segment Profile", placeholder="Describe the profile of your target customer segment (e.g., age, gender, interests, profession)"),
72
  gr.Textbox(
73
- label="Your Value Proposition",
74
- placeholder="Describe how your solution to customer problems offers them unique value",
75
  ),
76
  gr.Textbox(
77
- label="Campaign Goal, Special Event, Promotion and Call to Action",
78
- placeholder="Describe your campaign goal, a special event, promotion and Call to Action that you hope your target segment will act upon",
79
  ),
80
- gr.Textbox(label="Subject Line", placeholder="Enter the Subject Line of the Email or ask for suggestions"),
81
- gr.Checkbox(label="Ask for Subject Line Suggestions", value=False),
 
 
 
 
82
  gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
83
  gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
84
  gr.Slider(
@@ -89,8 +95,8 @@ demo = gr.ChatInterface(
89
  label="Top-p (nucleus sampling)",
90
  ),
91
  ],
92
- title="Email Copywriter",
93
- description="This app creates a customized email that resonates with your customers to improve CTR and conversion. Based on your input. Powered by Hugging Face Inference, Design Thinking, and domain expertise. Expand Additional Inputs by clicking on the arrow, input more details about your customers, then a message describing what you need the assistant to do for you. Developed by wn. Disclaimer: AI makes mistakes. Use with caution and at your own risk!",
94
  )
95
 
96
 
 
12
  message,
13
  history: list[tuple[str, str]],
14
  system_message,
15
+ role,
16
+ ad,
17
+ education,
18
+ experience,
19
+ skills,
20
+ ask_for_skills_suggestions,
21
  max_tokens,
22
  temperature,
23
  top_p,
 
25
  # Construct the system message with additional inputs
26
  enhanced_system_message = (
27
  f"{system_message}\n\n"
28
+ f"Role, Industry and Type of Organization: {role}\n"
29
+ f"Job Ad Responsibilities and Key Requirements: {ad}\n"
30
+ f"Education, Training and Certifications: {education}\n"
31
+ f"Work Experience: {experience}\n"
32
+ f"Skills: {skills}\n"
33
  )
34
 
35
  # If the user wants Subject Line suggestions, modify the prompt
36
+ if ask_for_skills_suggestions:
37
+ enhanced_system_message += "The user is also asking for suggestions of skills related to this role."
38
 
39
  messages = [{"role": "system", "content": enhanced_system_message}]
40
 
 
67
  respond,
68
  additional_inputs=[
69
  gr.Textbox(
70
+ value="You are a friendly Chatbot, a career coach and a talented copywriter. You are trying to help a user customize their resume according to role and job Ad - based on user input.",
71
  label="Instructions to Bot",
72
  ),
73
+ gr.Textbox(label="Role, Industry and Employer", placeholder="Describe the role, industry and employer you are applying to."),
74
  gr.Textbox(
75
+ label="Job Ad Responsibilities and Key Requirements",
76
+ placeholder="Describe the Responsibilities and Key Requirements advertised in the job ad",
77
  ),
78
  gr.Textbox(
79
+ label="Your Education, certifications, training, etc.",
80
+ placeholder="Describe your education, training, certifications and professional designations",
81
  ),
82
+ gr.Textbox(
83
+ label="Your Work Experience",
84
+ placeholder="Describe your work experience, previous responsibilities and key career achievements",
85
+ ),
86
+ gr.Textbox(label="Skills", placeholder="List your key skills that match this job or ask for suggestions"),
87
+ gr.Checkbox(label="Ask for Skills Suggestions", value=False),
88
  gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
89
  gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
90
  gr.Slider(
 
95
  label="Top-p (nucleus sampling)",
96
  ),
97
  ],
98
+ title="Resumize - Customize your CV!",
99
+ description="This app creates a customizes your resume to best suit a specific role, industry, employer and job ad. Based on your input. Powered by Hugging Face Inference, Design Thinking, and domain expertise. Expand Additional Inputs by clicking on the arrow, input more details about your education, work experience, skills and the job you are applying for, then enter a message describing what you need the assistant to do for you. Developed by wn. Disclaimer: AI makes mistakes. Use with caution and at your own risk!",
100
  )
101
 
102