Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -28,15 +28,15 @@ def stream_llm(system_role, user_text, audio_path=None, file_path=None):
|
|
| 28 |
yield "### ⚠️ Attention Required\nPlease upload your CV in the Nexus tab or state your query."
|
| 29 |
return
|
| 30 |
|
| 31 |
-
# LIST OF MODELS TO PREVENT 429 ERRORS[cite: 4]
|
| 32 |
models_to_try = ["llama-3.3-70b-versatile", "llama-3.1-8b-instant"]
|
| 33 |
|
|
|
|
| 34 |
detail_cmd = """
|
| 35 |
\n\nCRITICAL SYSTEM RULES:
|
| 36 |
-
1. STRICT LANGUAGE MATCH:
|
| 37 |
-
2. HIGH-QUALITY VOICE: Professional,
|
| 38 |
3. EXTREME DETAIL: Structure with bold headings (###).
|
| 39 |
-
4. CLICKABLE RESOURCES: Include 5-10
|
| 40 |
"""
|
| 41 |
|
| 42 |
client = get_client()
|
|
@@ -78,19 +78,19 @@ def stream_llm(system_role, user_text, audio_path=None, file_path=None):
|
|
| 78 |
NEXUS_PROMPT = """You are an Elite Technical CV Auditor. Analyze the CV with extreme depth:
|
| 79 |
1. CORE STRENGTHS. 2. CRITICAL WEAKNESSES. 3. TECH SKILL MATRIX. 4. NETWORKING STRATEGY. 5. IMPROVEMENT ROADMAP."""
|
| 80 |
|
| 81 |
-
# ZEN: REINFORCED MOTIVATION[cite: 4]
|
| 82 |
ZEN_PROMPT = """You are a Master Motivational Strategist.
|
| 83 |
-
STRICT
|
| 84 |
-
|
| 85 |
-
MANDATORY EXAMPLES: Always include real-life examples of great leaders who failed before becoming icons, such as Steve Jobs being fired from his own company, Elon Musk's early SpaceX explosions, and Jack Ma being rejected from dozens of jobs.
|
| 86 |
-
TONE: High-energy, inspiring, and relentless."""
|
| 87 |
|
| 88 |
-
ORBIT_PROMPT = """You are a Lead Hiring Strategist. Create a 6-Month
|
| 89 |
|
| 90 |
-
|
|
|
|
|
|
|
|
|
|
| 91 |
|
| 92 |
# ==========================================
|
| 93 |
-
# 3. UI DESIGN (STABLE)
|
| 94 |
# ==========================================
|
| 95 |
custom_css = """
|
| 96 |
footer {display: none !important;}
|
|
@@ -139,7 +139,7 @@ with gr.Blocks(css=custom_css) as demo:
|
|
| 139 |
with gr.Tab("🧠 Zen"):
|
| 140 |
with gr.Row():
|
| 141 |
with gr.Column(elem_classes="glass-panel", scale=1):
|
| 142 |
-
gr.Markdown("#### 🔥 WARRIOR MODE\nPure motivation
|
| 143 |
a2 = gr.Audio(label="VOICE LOG", sources=["microphone"], type="filepath")
|
| 144 |
btn2 = gr.Button("ACTIVATE ZEN POWER", variant="primary")
|
| 145 |
with gr.Column(elem_classes="glass-panel", scale=1.5):
|
|
@@ -149,7 +149,7 @@ with gr.Blocks(css=custom_css) as demo:
|
|
| 149 |
with gr.Tab("📅 Orbit"):
|
| 150 |
with gr.Row():
|
| 151 |
with gr.Column(elem_classes="glass-panel", scale=1):
|
| 152 |
-
gr.Markdown("#### 🛰️ MISSION ROADMAP")
|
| 153 |
a3 = gr.Audio(label="VOICE COMMAND", sources=["microphone"], type="filepath")
|
| 154 |
btn3 = gr.Button("LAUNCH MASTER PLAN", variant="primary")
|
| 155 |
with gr.Column(elem_classes="glass-panel", scale=1.5):
|
|
@@ -159,7 +159,7 @@ with gr.Blocks(css=custom_css) as demo:
|
|
| 159 |
with gr.Tab("🎯 Pathfinder"):
|
| 160 |
with gr.Row():
|
| 161 |
with gr.Column(elem_classes="glass-panel", scale=1):
|
| 162 |
-
gr.Markdown("#### 🔭 MARKET MATCHING")
|
| 163 |
a_p = gr.Audio(label="VOICE COMMAND", sources=["microphone"], type="filepath")
|
| 164 |
btn_p = gr.Button("FIND MY INDUSTRY MATCH", variant="primary")
|
| 165 |
with gr.Column(elem_classes="glass-panel", scale=1.5):
|
|
|
|
| 28 |
yield "### ⚠️ Attention Required\nPlease upload your CV in the Nexus tab or state your query."
|
| 29 |
return
|
| 30 |
|
|
|
|
| 31 |
models_to_try = ["llama-3.3-70b-versatile", "llama-3.1-8b-instant"]
|
| 32 |
|
| 33 |
+
# UNIVERSAL LANGUAGE MIRRORING GUARD[cite: 1]
|
| 34 |
detail_cmd = """
|
| 35 |
\n\nCRITICAL SYSTEM RULES:
|
| 36 |
+
1. STRICT LANGUAGE MATCH: Identify the input language (English, Urdu, or Roman-Urdu) and respond ONLY in that exact language. NO SWITCHING.
|
| 37 |
+
2. HIGH-QUALITY VOICE: Professional, human, and empathetic tone.
|
| 38 |
3. EXTREME DETAIL: Structure with bold headings (###).
|
| 39 |
+
4. CLICKABLE RESOURCES: Include 5-10 specific clickable links.
|
| 40 |
"""
|
| 41 |
|
| 42 |
client = get_client()
|
|
|
|
| 78 |
NEXUS_PROMPT = """You are an Elite Technical CV Auditor. Analyze the CV with extreme depth:
|
| 79 |
1. CORE STRENGTHS. 2. CRITICAL WEAKNESSES. 3. TECH SKILL MATRIX. 4. NETWORKING STRATEGY. 5. IMPROVEMENT ROADMAP."""
|
| 80 |
|
|
|
|
| 81 |
ZEN_PROMPT = """You are a Master Motivational Strategist.
|
| 82 |
+
STRICT RULE: Only encourage and motivate. Remind users that failure is natural.
|
| 83 |
+
MANDATORY EXAMPLES: Steve Jobs, Elon Musk, and Jack Ma. Respond ONLY in user's input language."""
|
|
|
|
|
|
|
| 84 |
|
| 85 |
+
ORBIT_PROMPT = """You are a Lead Hiring Strategist. Create a 6-Month Roadmap (Month 1-2: Skill Gaps, Month 3-4: Projects, Month 5: Branding, Month 6: Applications). Respond ONLY in user's input language."""
|
| 86 |
|
| 87 |
+
# PATHFINDER: STRICT LANGUAGE REINFORCEMENT[cite: 1, 3]
|
| 88 |
+
PATH_PROMPT = """You are a Global Market Scout.
|
| 89 |
+
STRICT RULE: Detect the user's language and respond EXCLUSIVELY in that language. If the user asks in English, respond in English. If they use Roman-Urdu, respond in Roman-Urdu.
|
| 90 |
+
TASK: Identify Industry and Companies where the user fits perfectly based on their skills."""
|
| 91 |
|
| 92 |
# ==========================================
|
| 93 |
+
# 3. UI DESIGN (REMAINING STABLE)
|
| 94 |
# ==========================================
|
| 95 |
custom_css = """
|
| 96 |
footer {display: none !important;}
|
|
|
|
| 139 |
with gr.Tab("🧠 Zen"):
|
| 140 |
with gr.Row():
|
| 141 |
with gr.Column(elem_classes="glass-panel", scale=1):
|
| 142 |
+
gr.Markdown("#### 🔥 WARRIOR MODE\nPure motivation in your own language.")
|
| 143 |
a2 = gr.Audio(label="VOICE LOG", sources=["microphone"], type="filepath")
|
| 144 |
btn2 = gr.Button("ACTIVATE ZEN POWER", variant="primary")
|
| 145 |
with gr.Column(elem_classes="glass-panel", scale=1.5):
|
|
|
|
| 149 |
with gr.Tab("📅 Orbit"):
|
| 150 |
with gr.Row():
|
| 151 |
with gr.Column(elem_classes="glass-panel", scale=1):
|
| 152 |
+
gr.Markdown("#### 🛰️ MISSION ROADMAP\nRoadmap strictly matching your input language.")
|
| 153 |
a3 = gr.Audio(label="VOICE COMMAND", sources=["microphone"], type="filepath")
|
| 154 |
btn3 = gr.Button("LAUNCH MASTER PLAN", variant="primary")
|
| 155 |
with gr.Column(elem_classes="glass-panel", scale=1.5):
|
|
|
|
| 159 |
with gr.Tab("🎯 Pathfinder"):
|
| 160 |
with gr.Row():
|
| 161 |
with gr.Column(elem_classes="glass-panel", scale=1):
|
| 162 |
+
gr.Markdown("#### 🔭 MARKET MATCHING\nIndustry match in your exact language.")
|
| 163 |
a_p = gr.Audio(label="VOICE COMMAND", sources=["microphone"], type="filepath")
|
| 164 |
btn_p = gr.Button("FIND MY INDUSTRY MATCH", variant="primary")
|
| 165 |
with gr.Column(elem_classes="glass-panel", scale=1.5):
|