Spaces:
Sleeping
Sleeping
Upload 2 files
Browse files- app.py +140 -0
- requirements.txt +168 -0
app.py
ADDED
@@ -0,0 +1,140 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import io
|
2 |
+
|
3 |
+
# from dotenv import load_dotenv
|
4 |
+
#
|
5 |
+
# load_dotenv()
|
6 |
+
|
7 |
+
import streamlit as st
|
8 |
+
import os
|
9 |
+
from PIL import Image
|
10 |
+
import pdf2image
|
11 |
+
import google.generativeai as genai
|
12 |
+
import base64
|
13 |
+
|
14 |
+
|
15 |
+
|
16 |
+
genai.configure(api_key="AIzaSyBqPmsZAJrCsXme9wJBx9o4K71M9c1qzy8")
|
17 |
+
|
18 |
+
def ai_output(input, pdf_content, prompt):
|
19 |
+
model = genai.GenerativeModel('gemini-1.5-flash')
|
20 |
+
response = model.generate_content([input, pdf_content[0], prompt])
|
21 |
+
return response.text
|
22 |
+
|
23 |
+
def ai_ans(input,prompt):
|
24 |
+
model = genai.GenerativeModel('gemini-1.5-flash')
|
25 |
+
response = model.generate_content([input,prompt])
|
26 |
+
return response.text
|
27 |
+
|
28 |
+
def input_pdf_setup(uploaded_file):
|
29 |
+
if uploaded_file is not None:
|
30 |
+
images = pdf2image.convert_from_bytes(uploaded_file.read())
|
31 |
+
first_page = images[0]
|
32 |
+
img_byte_arr = io.BytesIO()
|
33 |
+
first_page.save(img_byte_arr, format='JPEG')
|
34 |
+
img_byte_arr = img_byte_arr.getvalue()
|
35 |
+
|
36 |
+
pdf_parts=[
|
37 |
+
{
|
38 |
+
"mime_type": "image/jpeg",
|
39 |
+
"data": base64.b64encode(img_byte_arr).decode() # encode to base64
|
40 |
+
}
|
41 |
+
]
|
42 |
+
return pdf_parts
|
43 |
+
else:
|
44 |
+
raise FileNotFoundError("No file uploaded")
|
45 |
+
|
46 |
+
st.set_page_config(page_title="ATS resume Expert")
|
47 |
+
st.header("HARIMAY ATS Tracking System")
|
48 |
+
input_text = st.text_area("job description: ", key = "input")
|
49 |
+
uploaded_file = st.file_uploader("Upload your resume (PDF)....", type=["pdf"])
|
50 |
+
job_role = st.text_area("Enter job role", key="job")
|
51 |
+
|
52 |
+
|
53 |
+
|
54 |
+
if uploaded_file is not None:
|
55 |
+
st.write("pdf file uploaded successfully")
|
56 |
+
|
57 |
+
submit1 = st.button("Tell me about the Resume")
|
58 |
+
|
59 |
+
submit2 = st.button("Percentage Match")
|
60 |
+
|
61 |
+
submit3 = st.button("Job skills")
|
62 |
+
|
63 |
+
|
64 |
+
|
65 |
+
input_prompt1 = """
|
66 |
+
You are an experienced Technical Human Resource Manager,your task is to review the provided resume against the job description.
|
67 |
+
Please share your professional evaluation on whether the candidate's profile aligns with the role.
|
68 |
+
Highlight the strengths and weaknesses of the applicant in relation to the specified job requirements.
|
69 |
+
"""
|
70 |
+
|
71 |
+
input_prompt2 = """
|
72 |
+
You are an skilled ATS (Applicant Tracking System) scanner with a deep understanding of ATS functionality,
|
73 |
+
your task is to evaluate the resume against the provided job description. give me the percentage of match if the resume matches
|
74 |
+
the job description. First the output should come as percentage and then keywords missing and last final thoughts.
|
75 |
+
"""
|
76 |
+
|
77 |
+
input_prompt3 = """
|
78 |
+
You are an advanced career advisor and job market expert with deep insights into various industries. When given a job role, your task is to identify and list the key skills and qualifications that are most commonly required for success in that position. Please provide a structured output that includes:
|
79 |
+
|
80 |
+
1. A detailed list of technical and hard skills.
|
81 |
+
2. A summary of soft skills crucial for the role.
|
82 |
+
3. Recommended educational qualifications and certifications associated with the job.
|
83 |
+
"""
|
84 |
+
|
85 |
+
if submit1:
|
86 |
+
if uploaded_file is not None:
|
87 |
+
pdf_content = input_pdf_setup(uploaded_file)
|
88 |
+
response = ai_output(input_text,pdf_content,input_prompt1)
|
89 |
+
st.subheader("The Response is...")
|
90 |
+
st.write(response)
|
91 |
+
else:
|
92 |
+
st.write("Please uploaded the Resunme.")
|
93 |
+
elif submit2:
|
94 |
+
if uploaded_file is not None:
|
95 |
+
pdf_content = input_pdf_setup(uploaded_file)
|
96 |
+
response = ai_output(input_text,pdf_content,input_prompt2)
|
97 |
+
st.subheader("The Response is...")
|
98 |
+
st.write(response)
|
99 |
+
else:
|
100 |
+
st.write("Please uploaded the Resunme.")
|
101 |
+
|
102 |
+
elif submit3:
|
103 |
+
response = ai_ans(job_role,input_prompt3)
|
104 |
+
st.subheader("The Response is...")
|
105 |
+
st.write(response)
|
106 |
+
|
107 |
+
with st.expander("Generate Cover Letter"):
|
108 |
+
applicant_name = st.text_input("Enter Your Name")
|
109 |
+
contact_info = st.text_input("Enter Your Contact Information (Email, Phone)")
|
110 |
+
company_name = st.text_input("Enter the Company Name")
|
111 |
+
hiring_manager_name = st.text_input("Enter the Hiring Manager's Name (optional)")
|
112 |
+
job_role = st.text_area("Enter job role")
|
113 |
+
|
114 |
+
if uploaded_file is not None:
|
115 |
+
pdf_content = input_pdf_setup(uploaded_file)
|
116 |
+
cover_letter_button = st.button("Generate Cover Letter")
|
117 |
+
if not applicant_name:
|
118 |
+
st.write("Warning: Applicant's Name is missing.")
|
119 |
+
if not contact_info:
|
120 |
+
st.write("Warning: Contact Information is missing.")
|
121 |
+
|
122 |
+
if cover_letter_button:
|
123 |
+
# Define the input prompt for the cover letter
|
124 |
+
input_prompt_cover_letter = f"""
|
125 |
+
You are an expert cover letter writer. Generate a tailored cover letter using the following details:
|
126 |
+
|
127 |
+
Applicant's Name: {applicant_name}
|
128 |
+
Contact Information: {contact_info}
|
129 |
+
Company Name: {company_name}
|
130 |
+
Hiring Manager's Name: {hiring_manager_name}
|
131 |
+
Job Role/Position Name: {job_role}
|
132 |
+
|
133 |
+
The cover letter should include an engaging introduction, highlight relevant skills and experiences,
|
134 |
+
and conclude with a strong closing statement expressing enthusiasm for the role.
|
135 |
+
"""
|
136 |
+
cover_letter_response = ai_output(input_text, pdf_content, input_prompt_cover_letter)
|
137 |
+
st.subheader("Generated Cover Letter:")
|
138 |
+
st.write(cover_letter_response)
|
139 |
+
else:
|
140 |
+
st.write("Please upload the Resume to generate a cover letter.")
|
requirements.txt
ADDED
@@ -0,0 +1,168 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
aiofiles==23.2.1
|
2 |
+
aiohappyeyeballs==2.4.3
|
3 |
+
aiohttp==3.10.10
|
4 |
+
aiosignal==1.3.1
|
5 |
+
altair==5.4.1
|
6 |
+
annotated-types==0.7.0
|
7 |
+
anyio==4.6.2.post1
|
8 |
+
asttokens==2.4.1
|
9 |
+
attrs==24.2.0
|
10 |
+
beautifulsoup4==4.12.3
|
11 |
+
blinker==1.9.0
|
12 |
+
cachetools==5.5.0
|
13 |
+
certifi==2024.8.30
|
14 |
+
charset-normalizer==3.4.0
|
15 |
+
click==8.1.7
|
16 |
+
colorama==0.4.6
|
17 |
+
comm==0.2.2
|
18 |
+
dataclasses-json==0.6.7
|
19 |
+
debugpy==1.8.7
|
20 |
+
decorator==5.1.1
|
21 |
+
Deprecated==1.2.14
|
22 |
+
dirtyjson==1.0.8
|
23 |
+
distro==1.9.0
|
24 |
+
executing==2.1.0
|
25 |
+
fastapi==0.115.5
|
26 |
+
ffmpy==0.4.0
|
27 |
+
filelock==3.16.1
|
28 |
+
frozenlist==1.5.0
|
29 |
+
fsspec==2024.10.0
|
30 |
+
gitdb==4.0.11
|
31 |
+
GitPython==3.1.43
|
32 |
+
google-ai-generativelanguage==0.6.10
|
33 |
+
google-api-core==2.23.0
|
34 |
+
google-api-python-client==2.153.0
|
35 |
+
google-auth==2.36.0
|
36 |
+
google-auth-httplib2==0.2.0
|
37 |
+
google-generativeai==0.8.3
|
38 |
+
googleapis-common-protos==1.66.0
|
39 |
+
gradio==5.6.0
|
40 |
+
gradio_client==1.4.3
|
41 |
+
greenlet==3.1.1
|
42 |
+
grpcio==1.68.0
|
43 |
+
grpcio-status==1.68.0
|
44 |
+
h11==0.14.0
|
45 |
+
httpcore==1.0.6
|
46 |
+
httplib2==0.22.0
|
47 |
+
httpx==0.27.2
|
48 |
+
huggingface-hub==0.26.2
|
49 |
+
idna==3.10
|
50 |
+
ipykernel==6.29.5
|
51 |
+
ipython==8.29.0
|
52 |
+
jedi==0.19.1
|
53 |
+
Jinja2==3.1.4
|
54 |
+
jiter==0.7.0
|
55 |
+
joblib==1.4.2
|
56 |
+
jsonschema==4.23.0
|
57 |
+
jsonschema-specifications==2024.10.1
|
58 |
+
jupyter_client==8.6.3
|
59 |
+
jupyter_core==5.7.2
|
60 |
+
llama-cloud==0.1.4
|
61 |
+
llama-index==0.11.22
|
62 |
+
llama-index-agent-openai==0.3.4
|
63 |
+
llama-index-cli==0.3.1
|
64 |
+
llama-index-core==0.11.22
|
65 |
+
llama-index-embeddings-openai==0.2.5
|
66 |
+
llama-index-indices-managed-llama-cloud==0.4.0
|
67 |
+
llama-index-legacy==0.9.48.post3
|
68 |
+
llama-index-llms-openai==0.2.16
|
69 |
+
llama-index-multi-modal-llms-openai==0.2.3
|
70 |
+
llama-index-program-openai==0.2.0
|
71 |
+
llama-index-question-gen-openai==0.2.0
|
72 |
+
llama-index-readers-file==0.2.2
|
73 |
+
llama-index-readers-llama-parse==0.3.0
|
74 |
+
llama-parse==0.5.13
|
75 |
+
lxml==5.3.0
|
76 |
+
markdown-it-py==3.0.0
|
77 |
+
MarkupSafe==2.1.5
|
78 |
+
marshmallow==3.23.1
|
79 |
+
matplotlib-inline==0.1.7
|
80 |
+
mdurl==0.1.2
|
81 |
+
mpmath==1.3.0
|
82 |
+
multidict==6.1.0
|
83 |
+
mypy-extensions==1.0.0
|
84 |
+
narwhals==1.13.5
|
85 |
+
nest-asyncio==1.6.0
|
86 |
+
networkx==3.4.2
|
87 |
+
nltk==3.9.1
|
88 |
+
numpy==1.26.4
|
89 |
+
openai==1.54.2
|
90 |
+
orjson==3.10.11
|
91 |
+
packaging==24.1
|
92 |
+
pandas==2.2.3
|
93 |
+
parso==0.8.4
|
94 |
+
pdf2image==1.17.0
|
95 |
+
pillow==11.0.0
|
96 |
+
platformdirs==4.3.6
|
97 |
+
prompt_toolkit==3.0.48
|
98 |
+
propcache==0.2.0
|
99 |
+
proto-plus==1.25.0
|
100 |
+
protobuf==5.28.3
|
101 |
+
psutil==6.1.0
|
102 |
+
pure_eval==0.2.3
|
103 |
+
pyarrow==18.0.0
|
104 |
+
pyasn1==0.6.1
|
105 |
+
pyasn1_modules==0.4.1
|
106 |
+
pydantic==2.9.2
|
107 |
+
pydantic_core==2.23.4
|
108 |
+
pydeck==0.9.1
|
109 |
+
pydub==0.25.1
|
110 |
+
Pygments==2.18.0
|
111 |
+
PyMuPDF==1.24.13
|
112 |
+
pyparsing==3.2.0
|
113 |
+
pypdf==4.3.1
|
114 |
+
PyPDF2==3.0.1
|
115 |
+
python-dateutil==2.9.0.post0
|
116 |
+
python-docx==1.1.2
|
117 |
+
python-dotenv==1.0.1
|
118 |
+
python-multipart==0.0.12
|
119 |
+
pytz==2024.2
|
120 |
+
PyYAML==6.0.2
|
121 |
+
pyzmq==26.2.0
|
122 |
+
referencing==0.35.1
|
123 |
+
regex==2024.11.6
|
124 |
+
requests==2.32.3
|
125 |
+
rich==13.9.4
|
126 |
+
rpds-py==0.21.0
|
127 |
+
rsa==4.9
|
128 |
+
ruff==0.7.4
|
129 |
+
safehttpx==0.1.1
|
130 |
+
safetensors==0.4.5
|
131 |
+
scikit-learn==1.5.2
|
132 |
+
scipy==1.14.1
|
133 |
+
semantic-version==2.10.0
|
134 |
+
setuptools==75.5.0
|
135 |
+
shellingham==1.5.4
|
136 |
+
six==1.16.0
|
137 |
+
smmap==5.0.1
|
138 |
+
sniffio==1.3.1
|
139 |
+
soupsieve==2.6
|
140 |
+
SQLAlchemy==2.0.36
|
141 |
+
stack-data==0.6.3
|
142 |
+
starlette==0.41.2
|
143 |
+
streamlit==1.40.1
|
144 |
+
striprtf==0.0.26
|
145 |
+
sympy==1.13.1
|
146 |
+
tenacity==8.5.0
|
147 |
+
threadpoolctl==3.5.0
|
148 |
+
tiktoken==0.8.0
|
149 |
+
tokenizers==0.20.3
|
150 |
+
toml==0.10.2
|
151 |
+
tomlkit==0.12.0
|
152 |
+
torch==2.5.1
|
153 |
+
tornado==6.4.1
|
154 |
+
tqdm==4.67.0
|
155 |
+
traitlets==5.14.3
|
156 |
+
transformers==4.46.2
|
157 |
+
typer==0.13.0
|
158 |
+
typing-inspect==0.9.0
|
159 |
+
typing_extensions==4.12.2
|
160 |
+
tzdata==2024.2
|
161 |
+
uritemplate==4.1.1
|
162 |
+
urllib3==2.2.3
|
163 |
+
uvicorn==0.32.0
|
164 |
+
watchdog==6.0.0
|
165 |
+
wcwidth==0.2.13
|
166 |
+
websockets==12.0
|
167 |
+
wrapt==1.16.0
|
168 |
+
yarl==1.17.1
|