Ayo42 commited on
Commit
cedb7e1
Β·
verified Β·
1 Parent(s): c8c2d6b

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +72 -72
src/streamlit_app.py CHANGED
@@ -1,73 +1,73 @@
1
- import streamlit as st
2
- from io import BytesIO
3
-
4
- # === App Configuration ===
5
- st.set_page_config(
6
- page_title="FitCV - AI Resume Optimizer",
7
- page_icon="πŸ“„",
8
- layout="wide"
9
- )
10
-
11
- # === Header Section ===
12
- col1, col2 = st.columns([1, 6])
13
-
14
- with col1:
15
- st.image("assets/logo.png", width=40) # Replace with your own logo
16
-
17
- with col2:
18
- st.markdown(
19
- "<h1 style='font-size: 32px; display: inline;'>FitCV</h1><br>"
20
- "<span style='font-size:16px; color: gray;'>Your AI-Powered Resume Optimizer</span>",
21
- unsafe_allow_html=True
22
- )
23
-
24
- st.markdown("---")
25
-
26
- # === Input Section ===
27
- st.header("πŸ” Optimize Your Resume for the Job You Want")
28
-
29
- uploaded_cv = st.file_uploader("πŸ“„ Upload Your CV (PDF only)", type=["pdf"])
30
-
31
- github_username = st.text_input("πŸ™ Enter Your GitHub Username")
32
-
33
- job_mode = st.radio("What job info do you have?", ["Job Title", "Full Job Posting"])
34
-
35
- if job_mode == "Job Title":
36
- job_input = st.text_input("πŸ’Ό Enter the Job Title (e.g., Data Scientist at Google)")
37
- else:
38
- job_input = st.text_area("πŸ’¬ Paste the Full Job Posting")
39
-
40
- # === Button ===
41
- if st.button("✨ Optimize Resume"):
42
- if not uploaded_cv or not github_username or not job_input.strip():
43
- st.warning("Please fill in all fields and upload a valid resume.")
44
- else:
45
- with st.spinner("Analyzing your GitHub, resume, and job requirements..."):
46
-
47
- # === Placeholder: Call to your main pipeline logic ===
48
- from src.pipeline.recommend import refine_resume # Adjust path accordingly
49
-
50
- # Simulate reading bytes
51
- resume_bytes = uploaded_cv.read()
52
-
53
- result = refine_resume(
54
- resume_pdf_bytes=resume_bytes,
55
- github_username=github_username,
56
- job_input=job_input
57
- )
58
-
59
- # === Output Section ===
60
- st.success("βœ… Resume optimization complete!")
61
-
62
- st.subheader("πŸ“ Refined Professional Summary")
63
- st.write(result["summary"])
64
-
65
- st.subheader("🧠 Recommended Skills for This Role")
66
- st.write(", ".join(result["skills"]))
67
-
68
- st.subheader("πŸš€ GitHub Projects to Highlight")
69
- for proj in result["projects"]:
70
- st.markdown(f"- **[{proj['name']}]({proj['url']})**: {proj['description']}")
71
-
72
- st.markdown("---")
73
  st.info("These suggestions are tailored to the job you provided. You can now update your CV accordingly!")
 
1
+ import streamlit as st
2
+ from io import BytesIO
3
+
4
+ # === App Configuration ===
5
+ st.set_page_config(
6
+ page_title="FitCV - AI Resume Optimizer",
7
+ page_icon="πŸ“„",
8
+ layout="wide"
9
+ )
10
+
11
+ # === Header Section ===
12
+ col1, col2 = st.columns([1, 6])
13
+
14
+ with col1:
15
+ st.image("/assets/logo.png", width=40) # Replace with your own logo
16
+
17
+ with col2:
18
+ st.markdown(
19
+ "<h1 style='font-size: 32px; display: inline;'>FitCV</h1><br>"
20
+ "<span style='font-size:16px; color: gray;'>Your AI-Powered Resume Optimizer</span>",
21
+ unsafe_allow_html=True
22
+ )
23
+
24
+ st.markdown("---")
25
+
26
+ # === Input Section ===
27
+ st.header("πŸ” Optimize Your Resume for the Job You Want")
28
+
29
+ uploaded_cv = st.file_uploader("πŸ“„ Upload Your CV (PDF only)", type=["pdf"])
30
+
31
+ github_username = st.text_input("πŸ™ Enter Your GitHub Username")
32
+
33
+ job_mode = st.radio("What job info do you have?", ["Job Title", "Full Job Posting"])
34
+
35
+ if job_mode == "Job Title":
36
+ job_input = st.text_input("πŸ’Ό Enter the Job Title (e.g., Data Scientist at Google)")
37
+ else:
38
+ job_input = st.text_area("πŸ’¬ Paste the Full Job Posting")
39
+
40
+ # === Button ===
41
+ if st.button("✨ Optimize Resume"):
42
+ if not uploaded_cv or not github_username or not job_input.strip():
43
+ st.warning("Please fill in all fields and upload a valid resume.")
44
+ else:
45
+ with st.spinner("Analyzing your GitHub, resume, and job requirements..."):
46
+
47
+ # === Placeholder: Call to your main pipeline logic ===
48
+ from src.pipeline.recommend import refine_resume # Adjust path accordingly
49
+
50
+ # Simulate reading bytes
51
+ resume_bytes = uploaded_cv.read()
52
+
53
+ result = refine_resume(
54
+ resume_pdf_bytes=resume_bytes,
55
+ github_username=github_username,
56
+ job_input=job_input
57
+ )
58
+
59
+ # === Output Section ===
60
+ st.success("βœ… Resume optimization complete!")
61
+
62
+ st.subheader("πŸ“ Refined Professional Summary")
63
+ st.write(result["summary"])
64
+
65
+ st.subheader("🧠 Recommended Skills for This Role")
66
+ st.write(", ".join(result["skills"]))
67
+
68
+ st.subheader("πŸš€ GitHub Projects to Highlight")
69
+ for proj in result["projects"]:
70
+ st.markdown(f"- **[{proj['name']}]({proj['url']})**: {proj['description']}")
71
+
72
+ st.markdown("---")
73
  st.info("These suggestions are tailored to the job you provided. You can now update your CV accordingly!")