Anushkabhat9 commited on
Commit
9b9d05d
·
verified ·
1 Parent(s): b926e84

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -3
app.py CHANGED
@@ -10,6 +10,7 @@ Original file is located at
10
  import streamlit as st
11
  import os
12
  from resume_generation_gemini_pro import Gemini_pro_main # Import function from your model file
 
13
 
14
  # Helper function to save uploaded files temporarily and return their paths
15
  def save_uploaded_file(uploaded_file):
@@ -36,14 +37,23 @@ if uploaded_resume is not None and uploaded_job_description is not None:
36
  job_description_path = save_uploaded_file(uploaded_job_description)
37
  st.write(f"Files saved at: {resume_path} and {job_description_path}")
38
 
 
 
 
 
 
 
 
 
 
39
  # Generate tailored resume button
40
  if st.button("Generate Tailored Resume"):
41
  with st.spinner("Generating resume with Google Generative AI..."):
42
  # Call the model function with both file paths
43
- Gemini_pro_main(resume_path, job_description_path)
44
 
45
  # Display the generated tailored resume
46
- # st.subheader("Generated Tailored Resume:")
47
- # st.write(generated_resume)
48
  else:
49
  st.warning("Please upload both the current resume and job description files.")
 
10
  import streamlit as st
11
  import os
12
  from resume_generation_gemini_pro import Gemini_pro_main # Import function from your model file
13
+ from similarity_score_refined import similarity_main
14
 
15
  # Helper function to save uploaded files temporarily and return their paths
16
  def save_uploaded_file(uploaded_file):
 
37
  job_description_path = save_uploaded_file(uploaded_job_description)
38
  st.write(f"Files saved at: {resume_path} and {job_description_path}")
39
 
40
+ # Button to calculate similarity score
41
+ if st.button("Check Similarity Score"):
42
+ # Calculate the similarity score between resume and job description using similarity_main
43
+ similarity_score = similarity_main(resume_path, job_description_path)
44
+
45
+ # Display the similarity score on a slider
46
+ st.write("Similarity Score:")
47
+ st.slider("Similarity", min_value=0, max_value=100, value=int(similarity_score), format="%d%%")
48
+
49
  # Generate tailored resume button
50
  if st.button("Generate Tailored Resume"):
51
  with st.spinner("Generating resume with Google Generative AI..."):
52
  # Call the model function with both file paths
53
+ generated_resume = Gemini_pro_main(resume_path, job_description_path) # Assuming this function returns the resume text
54
 
55
  # Display the generated tailored resume
56
+ st.subheader("Generated Tailored Resume:")
57
+ st.write(generated_resume)
58
  else:
59
  st.warning("Please upload both the current resume and job description files.")