pktpaulie commited on
Commit
a5b117b
·
verified ·
1 Parent(s): b94c7a8

Update css and add autoscroll

Browse files
Files changed (1) hide show
  1. app.py +38 -29
app.py CHANGED
@@ -58,22 +58,20 @@ st.markdown("""
58
  background-color: #1A1A1A;
59
  box-shadow: rgba(0, 0, 0, 0.25) 0 8px 15px;
60
  transform: translateY(-2px);
61
- # background-color: #3A6FD8;
62
- # color: white;
63
 
64
 
65
  }
66
  /* From Uiverse.io by e-coders */
67
 
68
- .stButton>btn:disabled {
69
- pointer-events: none;
70
- }
71
-
72
 
73
- .stButton>:active {
74
- box-shadow: none;
75
- transform: translateY(0);
76
- }
77
  </style>
78
  """, unsafe_allow_html=True)
79
 
@@ -97,38 +95,41 @@ if uploaded_resume and uploaded_job_description:
97
 
98
  # Similarity Score Section
99
  st.markdown("---")
100
- st.subheader("Check Resume Similarity")
101
 
102
- if st.button("Check Similarity Score"):
 
103
  similarity_score = similarity_main(resume_path, job_description_path)
104
- if isinstance(similarity_score, str) and '%' in similarity_score:
105
- similarity_score = float(similarity_score.replace('%', ''))
106
-
107
- # Display messages based on score range
108
- if similarity_score < 50:
109
- st.markdown('<p style="color: red; font-weight: bold;">Low chance, need to modify your CV!</p>', unsafe_allow_html=True)
110
- pie_colors = ['#FF4B4B', '#E5E5E5']
111
- elif 50 <= similarity_score < 70:
112
- st.markdown('<p style="color: red; font-weight: bold;">Good chance but you can improve further!</p>')
113
- pie_colors = ['#FFC107', '#E5E5E5']
114
- else:
115
- st.markdown('<p style="color: green; font-weight: bold;">Excellent! You can submit your CV.</p>', unsafe_allow_html=True)
116
- pie_colors = ['#4CAF50', '#E5E5E5']
117
 
118
  # Display Score as a Pie Chart
119
  st.markdown(f"### Similarity Score: {int(similarity_score)}%")
120
 
121
  # Pie chart to show similarity
122
  fig, ax = plt.subplots()
123
- ax.pie([similarity_score, 100 - similarity_score], labels=['Match', 'Difference'], autopct='%1.1f%%', startangle=140, colors=['#4B7BE5', '#E5E5E5'])
124
- ax.axis('equal') # Equal aspect ratio ensures that pie is drawn as a circle.
 
 
125
  st.pyplot(fig)
126
 
127
  # Generate Tailored Resume Section
128
  st.markdown("---")
129
- st.subheader("Generate Tailored Resume")
130
 
131
- if st.button("Generate Tailored Resume"):
132
  with st.spinner("Generating resume..."):
133
  generated_resume = Gemini_pro_main(resume_path, job_description_path)
134
  st.subheader("Generated Tailored Resume:")
@@ -136,3 +137,11 @@ if uploaded_resume and uploaded_job_description:
136
 
137
  else:
138
  st.warning("Please upload both the resume and job description files.")
 
 
 
 
 
 
 
 
 
58
  background-color: #1A1A1A;
59
  box-shadow: rgba(0, 0, 0, 0.25) 0 8px 15px;
60
  transform: translateY(-2px);
61
+
 
62
 
63
 
64
  }
65
  /* From Uiverse.io by e-coders */
66
 
67
+ # .stButton>btn:disabled {
68
+ # pointer-events: none;
69
+ # }
 
70
 
71
+ # .stButton>:active {
72
+ # box-shadow: none;
73
+ # transform: translateY(0);
74
+ # }
75
  </style>
76
  """, unsafe_allow_html=True)
77
 
 
95
 
96
  # Similarity Score Section
97
  st.markdown("---")
98
+ st.subheader("Check Job Match")
99
 
100
+ if st.button("Resume-JD Matching"):
101
+ with st.spinner("Computing Match"):
102
  similarity_score = similarity_main(resume_path, job_description_path)
103
+ if isinstance(similarity_score, str) and '%' in similarity_score:
104
+ similarity_score = float(similarity_score.replace('%', ''))
105
+
106
+ # Display messages based on score range
107
+ if similarity_score < 50:
108
+ st.markdown('<p style="color: red; font-weight: bold;">Low chance, need to modify your CV!</p>', unsafe_allow_html=True)
109
+ pie_colors = ['#FF4B4B', '#E5E5E5']
110
+ elif 50 <= similarity_score < 70:
111
+ st.markdown('<p style="color: red; font-weight: bold;">Good chance but you can improve further!</p>')
112
+ pie_colors = ['#FFC107', '#E5E5E5']
113
+ else:
114
+ st.markdown('<p style="color: green; font-weight: bold;">Excellent! You can submit your CV.</p>', unsafe_allow_html=True)
115
+ pie_colors = ['#4CAF50', '#E5E5E5']
116
 
117
  # Display Score as a Pie Chart
118
  st.markdown(f"### Similarity Score: {int(similarity_score)}%")
119
 
120
  # Pie chart to show similarity
121
  fig, ax = plt.subplots()
122
+ # ax.pie([similarity_score, 100 - similarity_score], labels=['Match', 'Difference'], autopct='%1.1f%%', startangle=140, colors=['#4B7BE5', '#E5E5E5'])
123
+ ax.pie([similarity_score, 100 - similarity_score], labels=['Match', 'Difference'], autopct='%1.1f%%', startangle=140, colors=pie_colors)
124
+
125
+ ax.axis('equal')
126
  st.pyplot(fig)
127
 
128
  # Generate Tailored Resume Section
129
  st.markdown("---")
130
+ st.subheader("Tailor Resume")
131
 
132
+ if st.button("Tailor Resume"):
133
  with st.spinner("Generating resume..."):
134
  generated_resume = Gemini_pro_main(resume_path, job_description_path)
135
  st.subheader("Generated Tailored Resume:")
 
137
 
138
  else:
139
  st.warning("Please upload both the resume and job description files.")
140
+
141
+
142
+ #Autoscroll
143
+ st.markdown("""
144
+ <script>
145
+ window.scrollTo(0, document.body.scrollHeight);
146
+ </script>
147
+ """, unsafe_allow_html=True)