Arshad112 commited on
Commit
8280d4c
Β·
verified Β·
1 Parent(s): 5d924ed

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -9
app.py CHANGED
@@ -18,10 +18,10 @@ Your goal is to analyze resumes, identify missing keywords, rate resumes,
18
  and suggest better skills to highlight.
19
 
20
  ### Response Format:
21
- 1️⃣ **Resume Rating:** (Score out of 10)
22
- 2️⃣ **Missing Keywords:** (Comma-separated list)
23
- 3️⃣ **Suggested Skills:** (Bullet points)
24
- 4️⃣ **Expert Improvement Tips:** (Clear and actionable advice)
25
  """
26
 
27
  # Function to Extract Text from PDF
@@ -63,17 +63,31 @@ if uploaded_file is not None:
63
  stream=True,
64
  )
65
 
66
- # Stream response
67
  st.subheader("πŸ’‘ Resume Analysis")
68
  full_response = ""
69
  for chunk in completion:
70
  chunk_text = chunk.choices[0].delta.content or ""
71
  full_response += chunk_text
72
- st.write(chunk_text)
73
 
74
- # Display final response
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
  st.success("βœ… Resume analyzed successfully!")
76
  else:
77
  st.error("⚠️ No readable text found in the PDF. Please upload a valid resume.")
78
-
79
-
 
18
  and suggest better skills to highlight.
19
 
20
  ### Response Format:
21
+ **πŸ“Š Resume Rating:** _(Score out of 10)_
22
+ **πŸ” Missing Keywords:** _(Comma-separated list)_
23
+ **πŸ›  Suggested Skills:** _(Bullet points)_
24
+ **πŸ’‘ Expert Improvement Tips:** _(Clear and actionable advice)_
25
  """
26
 
27
  # Function to Extract Text from PDF
 
63
  stream=True,
64
  )
65
 
66
+ # Stream response and format correctly
67
  st.subheader("πŸ’‘ Resume Analysis")
68
  full_response = ""
69
  for chunk in completion:
70
  chunk_text = chunk.choices[0].delta.content or ""
71
  full_response += chunk_text
 
72
 
73
+ # Format Response
74
+ st.markdown("### **πŸ“Š Resume Rating**")
75
+ rating_part = full_response.split("**πŸ” Missing Keywords:**")[0].replace("**πŸ“Š Resume Rating:**", "").strip()
76
+ st.markdown(f"βœ… **Rating:** {rating_part}")
77
+
78
+ st.markdown("### **πŸ” Missing Keywords**")
79
+ missing_keywords_part = full_response.split("**πŸ” Missing Keywords:**")[1].split("**πŸ›  Suggested Skills:**")[0].strip()
80
+ st.markdown(f"πŸ”Ή {missing_keywords_part}")
81
+
82
+ st.markdown("### **πŸ›  Suggested Skills**")
83
+ suggested_skills_part = full_response.split("**πŸ›  Suggested Skills:**")[1].split("**πŸ’‘ Expert Improvement Tips:**")[0].strip()
84
+ st.markdown(f"πŸ”Έ {suggested_skills_part.replace('-', 'πŸ”Ή')}") # Convert hyphens to bullet points
85
+
86
+ st.markdown("### **πŸ’‘ Expert Improvement Tips**")
87
+ improvement_tips_part = full_response.split("**πŸ’‘ Expert Improvement Tips:**")[1].strip()
88
+ st.markdown(f"πŸ“Œ {improvement_tips_part.replace('-', 'πŸ“Œ')}") # Convert hyphens to bullet points
89
+
90
+ # Display success message
91
  st.success("βœ… Resume analyzed successfully!")
92
  else:
93
  st.error("⚠️ No readable text found in the PDF. Please upload a valid resume.")