Spaces:
Sleeping
Sleeping
File size: 1,240 Bytes
66e260e 4b52d41 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 34 35 36 |
from dotenv import load_dotenv
from components.functions import Functions
from components.prompts import keyword_analysis, keyword_synonyms
import streamlit as st
def run_analyzer(llm, doc='', jd='', analysis=False):
load_dotenv()
analyzer = Functions()
keyword = ''
if analysis:
message = "Suggesting Keywords to add in your Resume."
template = keyword_analysis
else:
message = "Suggesting Synonyms for Provided Keywords to add in your Resume."
keyword = st.text_input("Keyword")
if not keyword:
st.write("Please provide a keyword for synonyms.")
return
template = keyword_synonyms
st.write(message)
submit = st.button("Suggest Keywords" if analysis else "Generate Keywords")
if submit:
if doc is not None:
with st.spinner("Analyzing..."):
response = analyzer.get_gemini_response(llm=llm, template=template, doc=doc, input_text=jd, info=keyword)
st.subheader("The Keywords You Can Add:")
st.write(response)
else:
st.write("Please upload the resume")
if __name__ == "__main__":
analyzer = Functions()
run_analyzer(analyzer.model()) |