Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -179,16 +179,16 @@ def generate_resume(first_name, last_name, location, work_experience, school_exp
|
|
179 |
Returns:
|
180 |
str: The generated resume text.
|
181 |
"""
|
|
|
182 |
candidate_data = json.dumps({
|
183 |
-
"
|
184 |
-
"last_name": last_name,
|
185 |
"location": location,
|
|
|
|
|
|
|
186 |
"work_experience": work_experience,
|
187 |
"school_experience": school_experience,
|
188 |
"skills": skills,
|
189 |
-
"contact_number": contact_number,
|
190 |
-
"email_address": email_address,
|
191 |
-
"linkedin_profile": linkedin_profile
|
192 |
}, indent=2)
|
193 |
|
194 |
messages = [
|
@@ -197,6 +197,8 @@ def generate_resume(first_name, last_name, location, work_experience, school_exp
|
|
197 |
Your goal is to create a compelling and highly effective resume that showcases the candidate's strengths and experiences in a clear, concise, and ATS-friendly format.
|
198 |
|
199 |
You are an expert in using bullet points to quantify experience with metrics and achievements.
|
|
|
|
|
200 |
"""},
|
201 |
{"role": "user", "content": f"""
|
202 |
Generate a **highly professional**, **ATS-optimized resume** using the following structured information. Focus on:
|
@@ -204,6 +206,7 @@ def generate_resume(first_name, last_name, location, work_experience, school_exp
|
|
204 |
* **Keywords:** Incorporate industry-specific keywords naturally.
|
205 |
* **Action Verbs:** Start each bullet point with strong action verbs.
|
206 |
* **Conciseness:** Keep sentences short and to the point.
|
|
|
207 |
|
208 |
{candidate_data}
|
209 |
|
@@ -404,7 +407,7 @@ def save_text_as_file(text, filename, file_format):
|
|
404 |
def main():
|
405 |
st.set_page_config(page_title="AI Resume & Cover Letter Generator", layout="wide")
|
406 |
st.title("π AI-Powered Resume & Cover Letter Generator")
|
407 |
-
st.markdown("### Create a **perfect ATS-friendly Resume** and **tailored Cover Letter** ")
|
408 |
|
409 |
# Sidebar for API key and advanced settings
|
410 |
with st.sidebar:
|
@@ -466,14 +469,14 @@ def main():
|
|
466 |
|
467 |
with st.form("resume_form"):
|
468 |
col1, col2 = st.columns(2)
|
469 |
-
first_name = col1.text_input("First Name", help="Enter your first name.")
|
470 |
-
last_name = col2.text_input("Last Name", help="Enter your last name.")
|
471 |
-
location = st.text_input("Location", help="Enter your city and state.")
|
472 |
-
contact_number = st.text_input("Contact Number", help="Enter your phone number.")
|
473 |
-
email_address = st.text_input("Email Address", help="Enter your email address.")
|
474 |
linkedin_profile = st.text_input("LinkedIn Profile URL", help="Enter your LinkedIn profile URL (optional).")
|
475 |
-
work_experience = st.text_area("Work Experience", height=150, help="Describe your work experience, including job titles, company names, dates of employment, and responsibilities/achievements.")
|
476 |
-
school_experience = st.text_area("Education", height=150, help="Describe your educational background, including degree names, university names, and graduation dates.")
|
477 |
skills = st.text_area("Skills", height=100, help="List your skills, separated by commas.")
|
478 |
submit = st.form_submit_button("π Generate Resume")
|
479 |
|
@@ -481,8 +484,10 @@ def main():
|
|
481 |
if not os.getenv("GROQ_API_KEY"):
|
482 |
st.error("Please enter your Groq API key in the sidebar.")
|
483 |
return
|
|
|
484 |
with st.spinner("π Creating Resume..."):
|
485 |
resume_text = generate_resume(first_name, last_name, location, work_experience, school_experience, skills, contact_number, email_address, linkedin_profile)
|
|
|
486 |
if resume_text:
|
487 |
st.success("β
Resume Generated!")
|
488 |
st.text_area("π Your Resume:", resume_text, height=400)
|
|
|
179 |
Returns:
|
180 |
str: The generated resume text.
|
181 |
"""
|
182 |
+
|
183 |
candidate_data = json.dumps({
|
184 |
+
"full_name": f"{first_name} {last_name}", # Added full_name
|
|
|
185 |
"location": location,
|
186 |
+
"contact_number": contact_number, # Include contact_number
|
187 |
+
"email_address": email_address, # Include email_address
|
188 |
+
"linkedin_profile": linkedin_profile, # Include linkedin_profile
|
189 |
"work_experience": work_experience,
|
190 |
"school_experience": school_experience,
|
191 |
"skills": skills,
|
|
|
|
|
|
|
192 |
}, indent=2)
|
193 |
|
194 |
messages = [
|
|
|
197 |
Your goal is to create a compelling and highly effective resume that showcases the candidate's strengths and experiences in a clear, concise, and ATS-friendly format.
|
198 |
|
199 |
You are an expert in using bullet points to quantify experience with metrics and achievements.
|
200 |
+
|
201 |
+
You will focus on extracting information given in work experience, education, and skills to accurately tailor the resume
|
202 |
"""},
|
203 |
{"role": "user", "content": f"""
|
204 |
Generate a **highly professional**, **ATS-optimized resume** using the following structured information. Focus on:
|
|
|
206 |
* **Keywords:** Incorporate industry-specific keywords naturally.
|
207 |
* **Action Verbs:** Start each bullet point with strong action verbs.
|
208 |
* **Conciseness:** Keep sentences short and to the point.
|
209 |
+
* **Use the info provided and do not make things up.**
|
210 |
|
211 |
{candidate_data}
|
212 |
|
|
|
407 |
def main():
|
408 |
st.set_page_config(page_title="AI Resume & Cover Letter Generator", layout="wide")
|
409 |
st.title("π AI-Powered Resume & Cover Letter Generator")
|
410 |
+
st.markdown("### Create a **perfect ATS-friendly Resume** and **tailored Cover Letter** using **Groq AI (Llama 3.3-70B)**")
|
411 |
|
412 |
# Sidebar for API key and advanced settings
|
413 |
with st.sidebar:
|
|
|
469 |
|
470 |
with st.form("resume_form"):
|
471 |
col1, col2 = st.columns(2)
|
472 |
+
first_name = col1.text_input("First Name", help="Enter your first name.", value="Oluwafemi") # Pre-filled value
|
473 |
+
last_name = col2.text_input("Last Name", help="Enter your last name.", value="Idiakhoa") # Pre-filled value
|
474 |
+
location = st.text_input("Location", help="Enter your city and state.", value="Houston, Texas") # Pre-filled value
|
475 |
+
contact_number = st.text_input("Contact Number", help="Enter your phone number.", value="404-922-0516") # Pre-filled value
|
476 |
+
email_address = st.text_input("Email Address", help="Enter your email address.", value="[email protected]") # Pre-filled value
|
477 |
linkedin_profile = st.text_input("LinkedIn Profile URL", help="Enter your LinkedIn profile URL (optional).")
|
478 |
+
work_experience = st.text_area("Work Experience", height=150, help="Describe your work experience, including job titles, company names, dates of employment, and responsibilities/achievements.", value="Verizon feb-2023") # Pre-filled value
|
479 |
+
school_experience = st.text_area("Education", height=150, help="Describe your educational background, including degree names, university names, and graduation dates.", value="Master in Engineering") # Pre-filled value
|
480 |
skills = st.text_area("Skills", height=100, help="List your skills, separated by commas.")
|
481 |
submit = st.form_submit_button("π Generate Resume")
|
482 |
|
|
|
484 |
if not os.getenv("GROQ_API_KEY"):
|
485 |
st.error("Please enter your Groq API key in the sidebar.")
|
486 |
return
|
487 |
+
|
488 |
with st.spinner("π Creating Resume..."):
|
489 |
resume_text = generate_resume(first_name, last_name, location, work_experience, school_experience, skills, contact_number, email_address, linkedin_profile)
|
490 |
+
|
491 |
if resume_text:
|
492 |
st.success("β
Resume Generated!")
|
493 |
st.text_area("π Your Resume:", resume_text, height=400)
|