Spaces:
Build error
Build error
bug fixes
Browse files
app.py
CHANGED
|
@@ -8,22 +8,6 @@ def load_txt_file(txt_file):
|
|
| 8 |
txt_str_contents = f.read()
|
| 9 |
return txt_str_contents
|
| 10 |
|
| 11 |
-
def load_resume(uploaded_file):
|
| 12 |
-
try:
|
| 13 |
-
if hasattr(uploaded_file, 'name'): # Handle uploaded file
|
| 14 |
-
with open(uploaded_file.name, 'r', encoding='utf-8') as f:
|
| 15 |
-
data = yaml.safe_load(f)
|
| 16 |
-
else: # Handle string path
|
| 17 |
-
with open(uploaded_file, 'r', encoding='utf-8') as f:
|
| 18 |
-
data = yaml.safe_load(f)
|
| 19 |
-
|
| 20 |
-
if not isinstance(data, dict):
|
| 21 |
-
return None, f"Error: Resume data is not a dictionary (got {type(data)})"
|
| 22 |
-
|
| 23 |
-
return data, "Successfully loaded resume data"
|
| 24 |
-
except Exception as e:
|
| 25 |
-
return None, f"Error loading resume: {e}"
|
| 26 |
-
|
| 27 |
def load_initial_resume(file_path):
|
| 28 |
try:
|
| 29 |
with open(file_path, 'r', encoding='utf-8') as f:
|
|
@@ -44,14 +28,13 @@ with gr.Blocks() as demo:
|
|
| 44 |
Sample files have been provided for each input to help you get started. You can upload your own files to replace the samples.
|
| 45 |
|
| 46 |
## Instructions
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
- Cover Letter Writing Sample: a .txt file containing a writing sample of a cover letter.
|
| 55 |
''')
|
| 56 |
|
| 57 |
### File management
|
|
@@ -120,4 +103,4 @@ with gr.Blocks() as demo:
|
|
| 120 |
|
| 121 |
|
| 122 |
if __name__ == "__main__":
|
| 123 |
-
demo.launch(
|
|
|
|
| 8 |
txt_str_contents = f.read()
|
| 9 |
return txt_str_contents
|
| 10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
def load_initial_resume(file_path):
|
| 12 |
try:
|
| 13 |
with open(file_path, 'r', encoding='utf-8') as f:
|
|
|
|
| 28 |
Sample files have been provided for each input to help you get started. You can upload your own files to replace the samples.
|
| 29 |
|
| 30 |
## Instructions
|
| 31 |
+
Upload all of the following files:
|
| 32 |
+
- Job Description: a .txt file containing the job description.
|
| 33 |
+
- Resume YAML: a .yaml file containing your work experience. See the provided template for formatting structure. Work experience bullets are grouped by job and category, where multiple variations of bullets may be stored to provide additional texture to the LLM.
|
| 34 |
+
- Additional Resume Context: a .txt file containing additional resume details that you don't want to tailor, but want to share with the LLM as extra context.
|
| 35 |
+
- Additional Freeform Context: a .txt file that elaborates on resume details to support the LLM. This information wouldn't normally be included on the resume. It can be unpolished writing and brutally honest background details that prevent the LLM from stretching the truth.
|
| 36 |
+
- Resume Summary Writing Sample: a .txt file containing a writing sample of a bullet list summary for the top of your resume.
|
| 37 |
+
- Cover Letter Writing Sample: a .txt file containing a writing sample of a cover letter.
|
|
|
|
| 38 |
''')
|
| 39 |
|
| 40 |
### File management
|
|
|
|
| 103 |
|
| 104 |
|
| 105 |
if __name__ == "__main__":
|
| 106 |
+
demo.launch(share=True)
|
utils.py
CHANGED
|
@@ -339,7 +339,7 @@ def _cover_letter_prompt(job_description, ksas, experience_bullets, technical_sk
|
|
| 339 |
- Match the general structure of the sample letter
|
| 340 |
- The reader should not be able to tell AI wrote the cover letter
|
| 341 |
|
| 342 |
-
Format the response as JSON: {{"cover_letter": "Dear Hiring Manager,\\n\\n[cover letter content]\\n\\nSincerely
|
| 343 |
|
| 344 |
def _cover_letter(job_description, ksas, experience_bullets, technical_skills, resume_context, summary, cover_letter_sample):
|
| 345 |
prompt = _cover_letter_prompt(job_description, ksas, experience_bullets, technical_skills, resume_context, summary, cover_letter_sample)
|
|
|
|
| 339 |
- Match the general structure of the sample letter
|
| 340 |
- The reader should not be able to tell AI wrote the cover letter
|
| 341 |
|
| 342 |
+
Format the response as JSON: {{"cover_letter": "Dear Hiring Manager,\\n\\n[cover letter content]\\n\\nSincerely,"}}"""
|
| 343 |
|
| 344 |
def _cover_letter(job_description, ksas, experience_bullets, technical_skills, resume_context, summary, cover_letter_sample):
|
| 345 |
prompt = _cover_letter_prompt(job_description, ksas, experience_bullets, technical_skills, resume_context, summary, cover_letter_sample)
|