shanmukavenkat commited on
Commit ·
571af42
1
Parent(s): 37ed59b
snvs
Browse files- .gitattributes +0 -1
- README.md +6 -8
- app.py +71 -3
- app_old_IBM.py +0 -3
- requirements.txt +8 -3
- requirements_old.txt +0 -3
.gitattributes
CHANGED
|
@@ -1,4 +1,3 @@
|
|
| 1 |
-
*.py filter=lfs diff=lfs merge=lfs -text
|
| 2 |
*.7z filter=lfs diff=lfs merge=lfs -text
|
| 3 |
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 4 |
*.bin filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
| 1 |
*.7z filter=lfs diff=lfs merge=lfs -text
|
| 2 |
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 3 |
*.bin filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
|
@@ -1,14 +1,12 @@
|
|
| 1 |
---
|
| 2 |
-
title: Career
|
| 3 |
-
emoji:
|
| 4 |
colorFrom: gray
|
| 5 |
-
colorTo:
|
| 6 |
-
sdk:
|
| 7 |
-
sdk_version:
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
-
license: afl-3.0
|
| 11 |
-
short_description: Career Advice Matching your Skills and Likes
|
| 12 |
---
|
| 13 |
|
| 14 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 1 |
---
|
| 2 |
+
title: Career Counselor
|
| 3 |
+
emoji: 🌖
|
| 4 |
colorFrom: gray
|
| 5 |
+
colorTo: green
|
| 6 |
+
sdk: streamlit
|
| 7 |
+
sdk_version: 1.41.1
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
|
|
|
|
|
|
| 10 |
---
|
| 11 |
|
| 12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
app.py
CHANGED
|
@@ -1,3 +1,71 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
import streamlit as st
|
| 3 |
+
from groq import Groq
|
| 4 |
+
|
| 5 |
+
# Securely set Groq API key (replace with your method for storing keys securely)
|
| 6 |
+
GROQ_API_KEY = "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" # Replace with your Groq API key
|
| 7 |
+
os.environ["GROQ_API_KEY"] = GROQ_API_KEY
|
| 8 |
+
|
| 9 |
+
# Initialize Groq client
|
| 10 |
+
client = Groq(api_key=os.environ.get("GROQ_API_KEY"))
|
| 11 |
+
|
| 12 |
+
# Title and Introduction
|
| 13 |
+
st.title("Career Counselor App")
|
| 14 |
+
st.write("I’m here to guide you toward the perfect career based on your skills, interests, and experience.")
|
| 15 |
+
|
| 16 |
+
# User Input Section
|
| 17 |
+
st.header("Tell us about yourself")
|
| 18 |
+
age = st.number_input("Age:", min_value=18, max_value=65, step=1)
|
| 19 |
+
education = st.text_input("Educational Background:")
|
| 20 |
+
skills = st.text_area("List your skills (e.g., Python, teamwork, CAD):")
|
| 21 |
+
interests = st.text_area("What areas of interest do you have? (e.g., AI, design, civil engineering):")
|
| 22 |
+
experience = st.text_area("Describe your experience (if any):")
|
| 23 |
+
|
| 24 |
+
# Function to get career suggestions from Groq
|
| 25 |
+
def suggest_careers_groq(skills, interests, experience):
|
| 26 |
+
try:
|
| 27 |
+
# Prepare the prompt for Groq's chat model
|
| 28 |
+
prompt = f"""
|
| 29 |
+
Based on the following details, suggest suitable career paths, job market trends, and necessary qualifications:
|
| 30 |
+
Skills: {skills}
|
| 31 |
+
Interests: {interests}
|
| 32 |
+
Experience: {experience}
|
| 33 |
+
"""
|
| 34 |
+
|
| 35 |
+
# Call the Groq API
|
| 36 |
+
chat_completion = client.chat.completions.create(
|
| 37 |
+
messages=[
|
| 38 |
+
{
|
| 39 |
+
"role": "user",
|
| 40 |
+
"content": prompt,
|
| 41 |
+
}
|
| 42 |
+
],
|
| 43 |
+
model="llama-3.3-70b-versatile", # Specify the model
|
| 44 |
+
stream=False,
|
| 45 |
+
)
|
| 46 |
+
|
| 47 |
+
# Extract and return the response
|
| 48 |
+
response_content = chat_completion.choices[0].message.content
|
| 49 |
+
return response_content
|
| 50 |
+
|
| 51 |
+
except Exception as e:
|
| 52 |
+
st.error(f"An error occurred while contacting Groq API: {e}")
|
| 53 |
+
return None
|
| 54 |
+
|
| 55 |
+
# Display recommendations based on user input
|
| 56 |
+
if st.button("Get Career Advice"):
|
| 57 |
+
if not skills or not interests:
|
| 58 |
+
st.error("Please provide your skills and interests to get career advice.")
|
| 59 |
+
else:
|
| 60 |
+
st.subheader("Career Recommendations")
|
| 61 |
+
response = suggest_careers_groq(skills, interests, experience)
|
| 62 |
+
if response:
|
| 63 |
+
st.write(response)
|
| 64 |
+
else:
|
| 65 |
+
st.write("No recommendations available. Please try again later.")
|
| 66 |
+
# Footer
|
| 67 |
+
st.markdown("---")
|
| 68 |
+
st.markdown(
|
| 69 |
+
"<p style='text-align: center; font-size: 14px;'>Designed by: <b>Engr. Makhdoom Muhammad Naeem Hashmi</b></p>",
|
| 70 |
+
unsafe_allow_html=True
|
| 71 |
+
)
|
app_old_IBM.py
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:4938ab7a5b8e1d4dda4590d7665d617e5e93e7c50b9fd908e8834838348ca0a6
|
| 3 |
-
size 3682
|
|
|
|
|
|
|
|
|
|
|
|
requirements.txt
CHANGED
|
@@ -1,3 +1,8 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
streamlit
|
| 2 |
+
groq
|
| 3 |
+
requests
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
|
| 8 |
+
|
requirements_old.txt
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
ibm-watson-machine-learning
|
| 2 |
-
gradio
|
| 3 |
-
python-dotenv
|
|
|
|
|
|
|
|
|
|
|
|