Spaces:
Running
Running
Update config.py
Browse files
config.py
CHANGED
@@ -2,6 +2,7 @@ from docx import Document
|
|
2 |
from docx.shared import Pt
|
3 |
from docx.enum.text import WD_PARAGRAPH_ALIGNMENT
|
4 |
import os
|
|
|
5 |
|
6 |
|
7 |
def write_email(name, company, ai_email):
|
@@ -33,3 +34,83 @@ def write_email(name, company, ai_email):
|
|
33 |
doc.save(file_path)
|
34 |
|
35 |
return file_path # Return the file path for Gradio to use
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
from docx.shared import Pt
|
3 |
from docx.enum.text import WD_PARAGRAPH_ALIGNMENT
|
4 |
import os
|
5 |
+
import zipfile
|
6 |
|
7 |
|
8 |
def write_email(name, company, ai_email):
|
|
|
34 |
doc.save(file_path)
|
35 |
|
36 |
return file_path # Return the file path for Gradio to use
|
37 |
+
|
38 |
+
def return_bulk_file():
|
39 |
+
output_folder = "./output"
|
40 |
+
# Create a ZIP file of the output folder
|
41 |
+
zip_file_path = "./output.zip"
|
42 |
+
with zipfile.ZipFile(zip_file_path, 'w', zipfile.ZIP_DEFLATED) as zipf:
|
43 |
+
for root, _, files in os.walk(output_folder):
|
44 |
+
for file in files:
|
45 |
+
file_full_path = os.path.join(root, file)
|
46 |
+
zipf.write(file_full_path, os.path.relpath(file_full_path, output_folder))
|
47 |
+
|
48 |
+
return zip_file_path # Return the ZIP file path for Gradio to use
|
49 |
+
|
50 |
+
# Define the system instruction
|
51 |
+
|
52 |
+
sys_instruct_gen = """
|
53 |
+
You are an AI assistant tasked with drafting a professional and personalized email to a hiring manager
|
54 |
+
expressing interest in a job opportunity at their company.
|
55 |
+
You need to adjust accordingly with grammar and spot possible areas where the info in the resume and that of the hiring manager/recruiter are relavent.
|
56 |
+
Make the email such that it piques the interest of the hiring manger, such as a certain skill set they need or can be of great value to them.
|
57 |
+
The email should adhere to the following template and should generate in 260 - 280 words consistently, with placeholders to be filled accordingly:
|
58 |
+
|
59 |
+
Subject: Seeking Opportunities to Contribute at {Company Name}
|
60 |
+
|
61 |
+
Dear {Hiring Manager's Name},
|
62 |
+
|
63 |
+
I hope this email finds you well. My name is [Extract Full Name from Resume], and I am writing to express my keen interest in exploring career opportunities at {Company Name}. Your organization's work in {Industry/Field} has greatly impressed me, particularly your contributions to {Specific Projects, Innovations, or Company Achievements}.
|
64 |
+
|
65 |
+
With a background in [Extract Academic Background: degree, university, and GPA], I have developed strong skills in [Extract Relevant Technical Skills] and gained hands-on experience through projects such as [Extract Relevant Projects from Resume]. My expertise in {Specific Skills or Tools Relevant to the Job} aligns well with the work being done at your company, and I am eager to bring my knowledge and passion to your team.
|
66 |
+
|
67 |
+
Additionally, my certification in Practical AI with Python showcases my commitment to continuous learning in AI and data-driven solutions. Furthermore, my proficiency in Japanese, certified by the JLPT N3, allows me to collaborate effectively in diverse and international work environments.
|
68 |
+
|
69 |
+
I am particularly interested in {Specific Roles, Teams, or Projects at the Company} and believe that my skills in {Extract Skills from Resume} would allow me to contribute meaningfully to your organization's goals. I have attached my resume for your review and would welcome the opportunity to discuss how my experience and expertise align with your company’s needs.
|
70 |
+
|
71 |
+
Thank you for your time and consideration. I look forward to the possibility of joining {Company Name} and contributing to its continued success.
|
72 |
+
|
73 |
+
Best regards,
|
74 |
+
[Extract Full Name from Resume]
|
75 |
+
|
76 |
+
Resume:
|
77 |
+
{}
|
78 |
+
|
79 |
+
"""
|
80 |
+
|
81 |
+
sys_instruct_jap = """
|
82 |
+
You are an AI assistant tasked with drafting a professional and personalized email to a hiring manager
|
83 |
+
expressing interest in a job opportunity at their company.
|
84 |
+
You need to adjust accordingly with grammar and spot possible areas where the info in the resume and that of the hiring manager/recruiter are relavent.
|
85 |
+
Make the email such that it piques the interest of the hiring manger, such as a certain skill set they need or can be of great value to them.
|
86 |
+
Always include japanese language point present in the template.
|
87 |
+
The email should adhere to the following template and should generate in 240 - 260 words consistently, with placeholders to be filled accordingly:
|
88 |
+
|
89 |
+
Subject: Seeking Opportunities to Contribute at {Company Name}
|
90 |
+
|
91 |
+
Dear {Hiring Manager's Name},
|
92 |
+
|
93 |
+
I hope this email finds you well. My name is [Extract Full Name from Resume], and I am writing to express my keen interest in exploring career opportunities at {Company Name}. Your organization's work in {Industry/Field} has greatly impressed me, particularly your contributions to {Specific Projects, Innovations, or Company Achievements}.
|
94 |
+
|
95 |
+
With a background in [Extract Academic Background: degree, university, and GPA], I have developed strong skills in [Extract Relevant Technical Skills] and gained hands-on experience through projects such as [Extract Relevant Projects from Resume].
|
96 |
+
|
97 |
+
My expertise in {Specific Skills or Tools Relevant to the Job} aligns well with the work being done at your company, and I am eager to bring my knowledge and passion to your team.
|
98 |
+
|
99 |
+
Furthermore, my proficiency in Japanese, certified by the JLPT N3, allows me to collaborate effectively in diverse and international work environments.
|
100 |
+
|
101 |
+
I am particularly interested in {Specific Roles, Teams, or Projects at the Company} and believe that my skills in {Extract Skills from Resume} would allow me to contribute meaningfully to your organization's goals. I have attached my resume for your review and would welcome the opportunity to discuss how my experience and expertise align with your company’s needs.
|
102 |
+
|
103 |
+
Thank you for your time and consideration. I look forward to the possibility of joining {Company Name} and contributing to its continued success.
|
104 |
+
|
105 |
+
Best regards,
|
106 |
+
[Extract Full Name from Resume]
|
107 |
+
|
108 |
+
Resume:
|
109 |
+
{}
|
110 |
+
|
111 |
+
"""
|
112 |
+
|
113 |
+
template = {
|
114 |
+
"General": sys_instruct_gen,
|
115 |
+
"Japanese specific": sys_instruct_jap
|
116 |
+
}
|