bkbilal09 commited on
Commit
f9ff10a
Β·
verified Β·
1 Parent(s): 0a5acdf

Upload 3 files

Browse files
Files changed (3) hide show
  1. README.md +14 -0
  2. app.py +154 -0
  3. requirements.txt +4 -0
README.md ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: AuraPath
3
+ emoji: πŸ”₯
4
+ colorFrom: indigo
5
+ colorTo: purple
6
+ sdk: gradio
7
+ python_version: '3.13'
8
+ app_file: app.py
9
+ pinned: false
10
+ license: mit
11
+ short_description: AI Career Growth & Mental Wellness Hub.
12
+ ---
13
+
14
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
app.py ADDED
@@ -0,0 +1,154 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import os
3
+ from openai import OpenAI
4
+
5
+ # ==========================================
6
+ # 1. CORE ENGINE
7
+ # ==========================================
8
+ def get_client():
9
+ api_key = os.environ.get("GROQ_API_KEY")
10
+ return OpenAI(api_key=api_key, base_url="https://api.groq.com/openai/v1")
11
+
12
+ def transcribe_audio(audio_path):
13
+ if audio_path is None: return ""
14
+ try:
15
+ client = get_client()
16
+ with open(audio_path, "rb") as audio_file:
17
+ transcript = client.audio.transcriptions.create(model="whisper-large-v3", file=audio_file)
18
+ return transcript.text
19
+ except Exception: return ""
20
+
21
+ def stream_llm(system_role, user_text, audio_path=None, file_path=None):
22
+ voice_content = transcribe_audio(audio_path) if audio_path else ""
23
+ file_context = f"\n[Document Provided: {os.path.basename(file_path)}]" if file_path else ""
24
+
25
+ combined_input = f"User Request: {user_text}\nVoice: {voice_content}\n{file_context}".strip()
26
+
27
+ if not combined_input and not file_path:
28
+ yield "### ⚠️ Attention Required\nPlease upload your CV in the Nexus tab or state your query."
29
+ return
30
+
31
+ try:
32
+ client = get_client()
33
+ detail_cmd = """
34
+ \n\nCRITICAL INSTRUCTIONS:
35
+ 1. LANGUAGE & VOICE CONSISTENCY: Detect the input language (English, Urdu, or Roman-Urdu) and respond EXCLUSIVELY in that same language.
36
+ 2. EXTREME DETAIL: Provide very long, exhaustive, and deeply structured responses using professional headings (###).
37
+ 3. LINKS: Include 5-10 specific clickable resource links [Title](URL).
38
+ """
39
+
40
+ response = client.chat.completions.create(
41
+ model="llama-3.3-70b-versatile",
42
+ messages=[
43
+ {"role": "system", "content": system_role + detail_cmd},
44
+ {"role": "user", "content": combined_input}
45
+ ],
46
+ stream=True
47
+ )
48
+
49
+ partial_text = ""
50
+ for chunk in response:
51
+ if chunk.choices[0].delta.content is not None:
52
+ partial_text += chunk.choices[0].delta.content
53
+ yield partial_text
54
+ except Exception as e:
55
+ yield f"### ⚠️ Connection Error\n{str(e)}"
56
+
57
+ # ==========================================
58
+ # 2. STRATEGIC SYSTEM PROMPTS
59
+ # ==========================================
60
+
61
+ NEXUS_PROMPT = """You are an Elite Technical CV Auditor. Analyze the CV with extreme depth:
62
+ 1. CORE STRENGTHS. 2. CRITICAL WEAKNESSES. 3. TECH SKILL MATRIX. 4. NETWORKING STRATEGY. 5. IMPROVEMENT ROADMAP."""
63
+
64
+ ZEN_PROMPT = """You are a High-Impact Motivational Strategist.
65
+ STRICT RULE: DO NOT ask the user any questions.
66
+ TASK: Deliver a MASSIVE, LENGTHY motivational speech based on user's goals.
67
+ 1. THE POWER OF FAILURE: Detail Edison's 999 failures, Colonel Sanders' 1009 rejections, and J.K. Rowling's struggle.
68
+ 2. BIG DREAMS: Encourage the user that 'Bare Khwab' are for them.
69
+ 3. ENERGY: Warrior-like language, very long and deep."""
70
+
71
+ ORBIT_PROMPT = "You are a Lead Hiring Strategist. Provide a full hiring pipeline and 6-month master plan."
72
+
73
+ # PATHFINDER: UPDATED TO INDUSTRY & SKILL MATCHING
74
+ PATH_PROMPT = """You are a Global Market Scout.
75
+ TASK: Analyze the user's CV and identify the exact Industry and Companies where they can get hired EASILY.
76
+ 1. CV-SKILL MATCH: Tell the user: 'Based on your CV having [Skills], you are a perfect fit for [Industry/Sector].'
77
+ 2. TARGET COMPANIES: List 5-10 specific companies where their current skills are in high demand.
78
+ 3. WHY YOU?: Explain why these companies will hire them easily.
79
+ 4. SALARY & BENEFITS: Provide detailed salary ranges and common perks (Health, Equity, etc.) for these roles.
80
+ 5. PREPARATION RESOURCES: Give direct links to master the specific interview style of these industries."""
81
+
82
+ # ==========================================
83
+ # 3. UI DESIGN (SHINE & GLOW)
84
+ # ==========================================
85
+ custom_css = """
86
+ footer {display: none !important;}
87
+ .gradio-container { background: linear-gradient(135deg, #0a0a2e 0%, #1a1a4b 25%, #4b0082 50%, #800080 75%, #ff007f 100%) !important; background-attachment: fixed !important;}
88
+ .glass-panel { background: rgba(10, 10, 30, 0.88) !important; backdrop-filter: blur(25px); border: 1px solid rgba(0, 242, 254, 0.3); border-radius: 20px; padding: 25px; }
89
+ .shimmer-title {
90
+ font-size: 4.5rem; font-weight: 900; color: #ffffff; text-transform: uppercase;
91
+ text-shadow: 0 0 10px #ff007f, 0 0 20px #ff007f, 0 0 40px #00f2fe;
92
+ animation: pulse-glow 2s ease-in-out infinite alternate; letter-spacing: 5px; margin-bottom: 0px;
93
+ }
94
+ @keyframes pulse-glow {
95
+ from { text-shadow: 0 0 10px #ff007f, 0 0 20px #ff007f, 0 0 40px #00f2fe; transform: scale(1); }
96
+ to { text-shadow: 0 0 20px #00f2fe, 0 0 40px #ff007f, 0 0 60px #00f2fe; transform: scale(1.02); }
97
+ }
98
+ .new-tagline { font-size: 1.2rem; color: #00f2fe; font-weight: bold; letter-spacing: 8px; text-transform: uppercase; margin-top: -10px; text-shadow: 0 0 5px #00f2fe; opacity: 0.9; }
99
+ .gr-button-primary { background: linear-gradient(90deg, #00f2fe 0%, #ff007f 100%) !important; border: none !important; font-weight: bold !important; }
100
+ input, textarea { background: rgba(0, 0, 0, 0.7) !important; color: white !important; border: 1px solid #00f2fe !important; }
101
+ """
102
+
103
+ with gr.Blocks(css=custom_css) as demo:
104
+ gr.HTML("""
105
+ <div style="text-align: center; padding: 40px 10px;">
106
+ <h1 class="shimmer-title">AURAPATH AI</h1>
107
+ <p class="new-tagline">β—ˆ ENGINEERING YOUR DESTINY β—ˆ</p>
108
+ </div>
109
+ """)
110
+
111
+ with gr.Tabs():
112
+ with gr.Tab("πŸ“„ Nexus"):
113
+ with gr.Row():
114
+ with gr.Column(elem_classes="glass-panel", scale=1):
115
+ f1 = gr.File(label="Upload CV / Portfolio")
116
+ t1 = gr.Textbox(label="TARGET GOAL", placeholder="e.g. Frontend at Google...", lines=4)
117
+ a1 = gr.Audio(label="VOICE SCAN", sources=["microphone"], type="filepath")
118
+ btn1 = gr.Button("INITIATE DEEP AUDIT", variant="primary")
119
+ with gr.Column(elem_classes="glass-panel", scale=1.5):
120
+ out1 = gr.Markdown("### πŸ” Technical Audit & Skill Matrix")
121
+ btn1.click(stream_llm, [gr.State(NEXUS_PROMPT), t1, a1, f1], out1)
122
+
123
+ with gr.Tab("🧠 Zen"):
124
+ with gr.Row():
125
+ with gr.Column(elem_classes="glass-panel", scale=1):
126
+ gr.Markdown("#### πŸ”₯ WARRIOR MODE\nNo questions. Only power. Based on your profile.")
127
+ a2 = gr.Audio(label="VOICE LOG", sources=["microphone"], type="filepath")
128
+ btn2 = gr.Button("ACTIVATE ZEN POWER", variant="primary")
129
+ with gr.Column(elem_classes="glass-panel", scale=1.5):
130
+ out2 = gr.Markdown("### πŸ”₯ High-Intensity Vision Protocol")
131
+ btn2.click(stream_llm, [gr.State(ZEN_PROMPT), t1, a2, f1], out2)
132
+
133
+ with gr.Tab("πŸ“… Orbit"):
134
+ with gr.Row():
135
+ with gr.Column(elem_classes="glass-panel", scale=1):
136
+ gr.Markdown("#### πŸ›°οΈ MISSION ROADMAP")
137
+ a3 = gr.Audio(label="VOICE COMMAND", sources=["microphone"], type="filepath")
138
+ btn3 = gr.Button("LAUNCH MASTER PLAN", variant="primary")
139
+ with gr.Column(elem_classes="glass-panel", scale=1.5):
140
+ out3 = gr.Markdown("### πŸ›£οΈ Strategic Execution Roadmap")
141
+ btn3.click(stream_llm, [gr.State(ORBIT_PROMPT), t1, a3, f1], out3)
142
+
143
+ with gr.Tab("🎯 Pathfinder"):
144
+ with gr.Row():
145
+ with gr.Column(elem_classes="glass-panel", scale=1):
146
+ gr.Markdown("#### πŸ”­ MARKET MATCHING\nFinding companies where you fit perfectly.")
147
+ a_p = gr.Audio(label="VOICE COMMAND", sources=["microphone"], type="filepath")
148
+ btn_p = gr.Button("FIND MY INDUSTRY MATCH", variant="primary")
149
+ with gr.Column(elem_classes="glass-panel", scale=1.5):
150
+ out_p = gr.Markdown("### 🏒 Skill-Based Industry & Company Match")
151
+ btn_p.click(stream_llm, [gr.State(PATH_PROMPT), t1, a_p, f1], out_p)
152
+
153
+ if __name__ == "__main__":
154
+ demo.launch()
requirements.txt ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ openai
2
+ gradio
3
+ PyPDF2
4
+ python-docx