Spaces:
Runtime error
Runtime error
Upload 4 files
Browse files- analyze.py +56 -0
- app.py +16 -0
- linkedin.py +56 -0
- resume.py +56 -0
analyze.py
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
import json
|
| 3 |
+
import google.generativeai as genai
|
| 4 |
+
|
| 5 |
+
def app():
|
| 6 |
+
|
| 7 |
+
# Configure Google Generative AI
|
| 8 |
+
genai.configure(api_key="AIzaSyD-61G3GhSY97O-X2AlpXGv1MYBBMRFmwg")
|
| 9 |
+
|
| 10 |
+
# Streamlit UI
|
| 11 |
+
st.title("Analysis of Responses")
|
| 12 |
+
|
| 13 |
+
uploaded_file = st.file_uploader("Choose a JSON file", type="json")
|
| 14 |
+
if uploaded_file is not None:
|
| 15 |
+
# Load the JSON file
|
| 16 |
+
data = json.load(uploaded_file)
|
| 17 |
+
# Set up the model configuration
|
| 18 |
+
generation_config = {
|
| 19 |
+
"temperature": 0.9,
|
| 20 |
+
"top_p": 1,
|
| 21 |
+
"top_k": 1,
|
| 22 |
+
"max_output_tokens": 2048,
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
safety_settings = [
|
| 26 |
+
{
|
| 27 |
+
"category": "HARM_CATEGORY_HARASSMENT",
|
| 28 |
+
"threshold": "BLOCK_MEDIUM_AND_ABOVE"
|
| 29 |
+
},
|
| 30 |
+
{
|
| 31 |
+
"category": "HARM_CATEGORY_HATE_SPEECH",
|
| 32 |
+
"threshold": "BLOCK_MEDIUM_AND_ABOVE"
|
| 33 |
+
},
|
| 34 |
+
{
|
| 35 |
+
"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT",
|
| 36 |
+
"threshold": "BLOCK_MEDIUM_AND_ABOVE"
|
| 37 |
+
},
|
| 38 |
+
{
|
| 39 |
+
"category": "HARM_CATEGORY_DANGEROUS_CONTENT",
|
| 40 |
+
"threshold": "BLOCK_MEDIUM_AND_ABOVE"
|
| 41 |
+
},
|
| 42 |
+
]
|
| 43 |
+
|
| 44 |
+
model = genai.GenerativeModel(model_name="gemini-1.0-pro",
|
| 45 |
+
generation_config=generation_config,
|
| 46 |
+
safety_settings=safety_settings)
|
| 47 |
+
|
| 48 |
+
# UI to trigger processing
|
| 49 |
+
if st.button("Generate Content"):
|
| 50 |
+
# Adjust the following line to match how you extract prompts from your JSON data
|
| 51 |
+
prompt_parts = f"Given an individual's career aspirations, core values, strengths, preferences, and skills, provide a comprehensive analysis that identifies key strengths, aligns these with career values, and suggests career paths. Then, recommend the top 5 job descriptions that would be a perfect fit based on the analysis. Here are the details: {data}"
|
| 52 |
+
response = model.generate_content(prompt_parts)
|
| 53 |
+
|
| 54 |
+
# Display the response
|
| 55 |
+
st.write("Generated Content:")
|
| 56 |
+
st.write(response.text)
|
app.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
import analyze
|
| 3 |
+
import linkedin
|
| 4 |
+
import resume
|
| 5 |
+
|
| 6 |
+
PAGES = {
|
| 7 |
+
"Analyze Responses": analyze,
|
| 8 |
+
"LinkedIn": linkedin,
|
| 9 |
+
"Resume": resume
|
| 10 |
+
}
|
| 11 |
+
|
| 12 |
+
st.sidebar.title('Main Menu')
|
| 13 |
+
selection = st.sidebar.radio("Go to", list(PAGES.keys()))
|
| 14 |
+
|
| 15 |
+
page = PAGES[selection]
|
| 16 |
+
page.app()
|
linkedin.py
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
import json
|
| 3 |
+
import google.generativeai as genai
|
| 4 |
+
|
| 5 |
+
def app():
|
| 6 |
+
|
| 7 |
+
# Configure Google Generative AI
|
| 8 |
+
genai.configure(api_key="AIzaSyD-61G3GhSY97O-X2AlpXGv1MYBBMRFmwg")
|
| 9 |
+
|
| 10 |
+
# Streamlit UI
|
| 11 |
+
st.title("LinkedIn")
|
| 12 |
+
|
| 13 |
+
uploaded_file = st.file_uploader("Choose a JSON file", type="json")
|
| 14 |
+
if uploaded_file is not None:
|
| 15 |
+
# Load the JSON file
|
| 16 |
+
data = json.load(uploaded_file)
|
| 17 |
+
# Set up the model configuration
|
| 18 |
+
generation_config = {
|
| 19 |
+
"temperature": 0.9,
|
| 20 |
+
"top_p": 1,
|
| 21 |
+
"top_k": 1,
|
| 22 |
+
"max_output_tokens": 2048,
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
safety_settings = [
|
| 26 |
+
{
|
| 27 |
+
"category": "HARM_CATEGORY_HARASSMENT",
|
| 28 |
+
"threshold": "BLOCK_MEDIUM_AND_ABOVE"
|
| 29 |
+
},
|
| 30 |
+
{
|
| 31 |
+
"category": "HARM_CATEGORY_HATE_SPEECH",
|
| 32 |
+
"threshold": "BLOCK_MEDIUM_AND_ABOVE"
|
| 33 |
+
},
|
| 34 |
+
{
|
| 35 |
+
"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT",
|
| 36 |
+
"threshold": "BLOCK_MEDIUM_AND_ABOVE"
|
| 37 |
+
},
|
| 38 |
+
{
|
| 39 |
+
"category": "HARM_CATEGORY_DANGEROUS_CONTENT",
|
| 40 |
+
"threshold": "BLOCK_MEDIUM_AND_ABOVE"
|
| 41 |
+
},
|
| 42 |
+
]
|
| 43 |
+
|
| 44 |
+
model = genai.GenerativeModel(model_name="gemini-1.0-pro",
|
| 45 |
+
generation_config=generation_config,
|
| 46 |
+
safety_settings=safety_settings)
|
| 47 |
+
|
| 48 |
+
# UI to trigger processing
|
| 49 |
+
if st.button("Generate Content"):
|
| 50 |
+
# Adjust the following line to match how you extract prompts from your JSON data
|
| 51 |
+
prompt_parts = f"Based on the following inputs, generate optimized content for a LinkedIn Bio, Header Bio, Experience, Skills, Certifications. Here are the details: {data}"
|
| 52 |
+
response = model.generate_content(prompt_parts)
|
| 53 |
+
|
| 54 |
+
# Display the response
|
| 55 |
+
st.write("Generated Content:")
|
| 56 |
+
st.write(response.text)
|
resume.py
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
import json
|
| 3 |
+
import google.generativeai as genai
|
| 4 |
+
|
| 5 |
+
def app():
|
| 6 |
+
|
| 7 |
+
# Configure Google Generative AI
|
| 8 |
+
genai.configure(api_key="AIzaSyD-61G3GhSY97O-X2AlpXGv1MYBBMRFmwg")
|
| 9 |
+
|
| 10 |
+
# Streamlit UI
|
| 11 |
+
st.title("Resume")
|
| 12 |
+
|
| 13 |
+
uploaded_file = st.file_uploader("Choose a JSON file", type="json")
|
| 14 |
+
if uploaded_file is not None:
|
| 15 |
+
# Load the JSON file
|
| 16 |
+
data = json.load(uploaded_file)
|
| 17 |
+
# Set up the model configuration
|
| 18 |
+
generation_config = {
|
| 19 |
+
"temperature": 0.9,
|
| 20 |
+
"top_p": 1,
|
| 21 |
+
"top_k": 1,
|
| 22 |
+
"max_output_tokens": 2048,
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
safety_settings = [
|
| 26 |
+
{
|
| 27 |
+
"category": "HARM_CATEGORY_HARASSMENT",
|
| 28 |
+
"threshold": "BLOCK_MEDIUM_AND_ABOVE"
|
| 29 |
+
},
|
| 30 |
+
{
|
| 31 |
+
"category": "HARM_CATEGORY_HATE_SPEECH",
|
| 32 |
+
"threshold": "BLOCK_MEDIUM_AND_ABOVE"
|
| 33 |
+
},
|
| 34 |
+
{
|
| 35 |
+
"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT",
|
| 36 |
+
"threshold": "BLOCK_MEDIUM_AND_ABOVE"
|
| 37 |
+
},
|
| 38 |
+
{
|
| 39 |
+
"category": "HARM_CATEGORY_DANGEROUS_CONTENT",
|
| 40 |
+
"threshold": "BLOCK_MEDIUM_AND_ABOVE"
|
| 41 |
+
},
|
| 42 |
+
]
|
| 43 |
+
|
| 44 |
+
model = genai.GenerativeModel(model_name="gemini-1.0-pro",
|
| 45 |
+
generation_config=generation_config,
|
| 46 |
+
safety_settings=safety_settings)
|
| 47 |
+
|
| 48 |
+
# UI to trigger processing
|
| 49 |
+
if st.button("Generate Content"):
|
| 50 |
+
# Adjust the following line to match how you extract prompts from your JSON data
|
| 51 |
+
prompt_parts = f" Based on the following inputs, print the basic details in proper manner line by line (name, github url, etc), generate a professional resume that includes sections for a Summary, Experience, Skills, Certifications (dont give education section). Provide optimized content for each section of the resume to highlight the individual's qualifications, achievements, and career progression. Here are the details: {data}"
|
| 52 |
+
response = model.generate_content(prompt_parts)
|
| 53 |
+
|
| 54 |
+
# Display the response
|
| 55 |
+
st.write("Generated Content:")
|
| 56 |
+
st.write(response.text)
|