Spaces:
Runtime error
Runtime error
Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -1,60 +1,2 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
import os
|
| 4 |
-
|
| 5 |
-
client = anthropic.Anthropic(api_key=os.environ.get("ANTHROPIC_API_KEY"))
|
| 6 |
-
|
| 7 |
-
def analyze_skill_gap(job_title, current_skills, experience_level):
|
| 8 |
-
prompt = f"""You are a career advisor and skill gap analyst.
|
| 9 |
-
|
| 10 |
-
Job Title Target: {job_title}
|
| 11 |
-
Current Skills: {current_skills}
|
| 12 |
-
Experience Level: {experience_level}
|
| 13 |
-
|
| 14 |
-
Analyze the skill gap and provide:
|
| 15 |
-
1. **Missing Critical Skills** - Must-have skills for this role
|
| 16 |
-
2. **Nice-to-Have Skills** - Bonus skills that help
|
| 17 |
-
3. **Learning Roadmap** - Step-by-step plan with resources
|
| 18 |
-
4. **Timeline Estimate** - Realistic time to bridge the gap
|
| 19 |
-
5. **Quick Wins** - Skills learnable in under 2 weeks
|
| 20 |
-
|
| 21 |
-
Be specific, practical, and encouraging."""
|
| 22 |
-
|
| 23 |
-
response = client.messages.create(
|
| 24 |
-
model="claude-opus-4-5",
|
| 25 |
-
max_tokens=1500,
|
| 26 |
-
messages=[{"role": "user", "content": prompt}]
|
| 27 |
-
)
|
| 28 |
-
return response.content[0].text
|
| 29 |
-
|
| 30 |
-
with gr.Blocks(theme=gr.themes.Soft(), title="SkillScope") as demo:
|
| 31 |
-
gr.Markdown("# 🎯 SkillScope — AI Skill Gap Analyzer")
|
| 32 |
-
gr.Markdown("Discover exactly what skills you need to land your dream job.")
|
| 33 |
-
|
| 34 |
-
with gr.Row():
|
| 35 |
-
with gr.Column(scale=1):
|
| 36 |
-
job_title = gr.Textbox(
|
| 37 |
-
label="Target Job Title",
|
| 38 |
-
placeholder="e.g. ML Engineer, Data Scientist"
|
| 39 |
-
)
|
| 40 |
-
current_skills = gr.Textbox(
|
| 41 |
-
label="Your Current Skills", lines=4,
|
| 42 |
-
placeholder="e.g. Python, basic ML, pandas, numpy..."
|
| 43 |
-
)
|
| 44 |
-
experience = gr.Dropdown(
|
| 45 |
-
choices=["Student / No experience", "0-1 years", "1-3 years", "3-5 years", "5+ years"],
|
| 46 |
-
label="Experience Level",
|
| 47 |
-
value="Student / No experience"
|
| 48 |
-
)
|
| 49 |
-
analyze_btn = gr.Button("🔍 Analyze My Skill Gap", variant="primary")
|
| 50 |
-
|
| 51 |
-
with gr.Column(scale=1):
|
| 52 |
-
output = gr.Markdown(label="Analysis", value="*Your analysis will appear here...*")
|
| 53 |
-
|
| 54 |
-
analyze_btn.click(
|
| 55 |
-
fn=analyze_skill_gap,
|
| 56 |
-
inputs=[job_title, current_skills, experience],
|
| 57 |
-
outputs=output
|
| 58 |
-
)
|
| 59 |
-
|
| 60 |
-
demo.launch()
|
|
|
|
| 1 |
+
# ... (your existing app.py code stays as is, but change the LAST LINE to:)
|
| 2 |
+
demo.launch(inbrowser=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|