File size: 1,210 Bytes
66e260e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from dotenv import load_dotenv
from components.functions import Functions
from components.prompts import ats_resume, ats_score

import streamlit as st

def run_ats(llm, doc='', jd='', manual=False):
    load_dotenv()
    ats = Functions()
    
    submit = st.button("Percentage match")
    
    if submit:
        if doc is not None:
            with st.spinner("Calculating Score..."):
                if manual:
                    response, keywords = ats.calculate_ats_score(resume_data=doc, job_description=jd)
                    st.subheader("The Keywords Missing:")
                    for i, keyword in enumerate(keywords):
                        st.caption(f"{i+1}. {keyword}")
                else:
                    response = ats.get_gemini_response(llm=llm, template=ats_score, doc=doc, input_text=jd)
                extra_response = ats.get_gemini_response(llm=llm, template=ats_resume, doc=doc, input_text=jd)
                
                st.subheader("The ATS Score is")
                st.write(response)
                st.write(extra_response)
        else:
            st.write("Please upload the resume")

if __name__ == "__main__":
    ats = Functions()
    run_ats(ats.model())