Spaces:
Running
Running
Upload folder using huggingface_hub
Browse files- README.md +3 -9
- app.py +131 -0
- me/cv.md +96 -0
- me/summary.txt +5 -0
- requirements.txt +6 -0
README.md
CHANGED
|
@@ -1,12 +1,6 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji: 📊
|
| 4 |
-
colorFrom: pink
|
| 5 |
-
colorTo: indigo
|
| 6 |
-
sdk: gradio
|
| 7 |
-
sdk_version: 6.0.2
|
| 8 |
app_file: app.py
|
| 9 |
-
|
|
|
|
| 10 |
---
|
| 11 |
-
|
| 12 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 1 |
---
|
| 2 |
+
title: Career_Conversation
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
app_file: app.py
|
| 4 |
+
sdk: gradio
|
| 5 |
+
sdk_version: 5.49.1
|
| 6 |
---
|
|
|
|
|
|
app.py
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from dotenv import load_dotenv
|
| 2 |
+
from openai import OpenAI
|
| 3 |
+
#from groq import Groq
|
| 4 |
+
import json
|
| 5 |
+
import os
|
| 6 |
+
import requests
|
| 7 |
+
import gradio as gr
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
load_dotenv(override=True)
|
| 11 |
+
|
| 12 |
+
def push(text):
|
| 13 |
+
requests.post(
|
| 14 |
+
"https://api.pushover.net/1/messages.json",
|
| 15 |
+
data={
|
| 16 |
+
"token": os.getenv("PUSHOVER_TOKEN"),
|
| 17 |
+
"user": os.getenv("PUSHOVER_USER"),
|
| 18 |
+
"message": text,
|
| 19 |
+
}
|
| 20 |
+
)
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
def record_user_details(email, name="Name not provided", notes="not provided"):
|
| 24 |
+
push(f"Recording {name} with email {email} and notes {notes}")
|
| 25 |
+
return {"recorded": "ok"}
|
| 26 |
+
|
| 27 |
+
def record_unknown_question(question):
|
| 28 |
+
push(f"Recording {question}")
|
| 29 |
+
return {"recorded": "ok"}
|
| 30 |
+
|
| 31 |
+
record_user_details_json = {
|
| 32 |
+
"name": "record_user_details",
|
| 33 |
+
"description": "Use this tool to record that a user is interested in being in touch and provided an email address",
|
| 34 |
+
"parameters": {
|
| 35 |
+
"type": "object",
|
| 36 |
+
"properties": {
|
| 37 |
+
"email": {
|
| 38 |
+
"type": "string",
|
| 39 |
+
"description": "The email address of this user"
|
| 40 |
+
},
|
| 41 |
+
"name": {
|
| 42 |
+
"type": "string",
|
| 43 |
+
"description": "The user's name, if they provided it"
|
| 44 |
+
}
|
| 45 |
+
,
|
| 46 |
+
"notes": {
|
| 47 |
+
"type": "string",
|
| 48 |
+
"description": "Any additional information about the conversation that's worth recording to give context"
|
| 49 |
+
}
|
| 50 |
+
},
|
| 51 |
+
"required": ["email"],
|
| 52 |
+
"additionalProperties": False
|
| 53 |
+
}
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
record_unknown_question_json = {
|
| 57 |
+
"name": "record_unknown_question",
|
| 58 |
+
"description": "Always use this tool to record any question that couldn't be answered as you didn't know the answer",
|
| 59 |
+
"parameters": {
|
| 60 |
+
"type": "object",
|
| 61 |
+
"properties": {
|
| 62 |
+
"question": {
|
| 63 |
+
"type": "string",
|
| 64 |
+
"description": "The question that couldn't be answered"
|
| 65 |
+
},
|
| 66 |
+
},
|
| 67 |
+
"required": ["question"],
|
| 68 |
+
"additionalProperties": False
|
| 69 |
+
}
|
| 70 |
+
}
|
| 71 |
+
|
| 72 |
+
tools = [{"type": "function", "function": record_user_details_json},
|
| 73 |
+
{"type": "function", "function": record_unknown_question_json}]
|
| 74 |
+
|
| 75 |
+
|
| 76 |
+
class Me:
|
| 77 |
+
|
| 78 |
+
def __init__(self):
|
| 79 |
+
self.openai = OpenAI()
|
| 80 |
+
#self.groq = Groq()
|
| 81 |
+
self.name = "Reda Baddy"
|
| 82 |
+
|
| 83 |
+
with open("me/cv.md", "r", encoding="utf-8") as f:
|
| 84 |
+
self.resume = f.read()
|
| 85 |
+
with open("me/summary.txt", "r", encoding="utf-8") as f:
|
| 86 |
+
self.summary = f.read()
|
| 87 |
+
|
| 88 |
+
|
| 89 |
+
def handle_tool_call(self, tool_calls):
|
| 90 |
+
results = []
|
| 91 |
+
for tool_call in tool_calls:
|
| 92 |
+
tool_name = tool_call.function.name
|
| 93 |
+
arguments = json.loads(tool_call.function.arguments)
|
| 94 |
+
print(f"Tool called: {tool_name}", flush=True)
|
| 95 |
+
tool = globals().get(tool_name)
|
| 96 |
+
result = tool(**arguments) if tool else {}
|
| 97 |
+
results.append({"role": "tool","content": json.dumps(result),"tool_call_id": tool_call.id})
|
| 98 |
+
return results
|
| 99 |
+
|
| 100 |
+
def system_prompt(self):
|
| 101 |
+
system_prompt = f"You are acting as {self.name}. You are answering questions on {self.name}'s website, \
|
| 102 |
+
particularly questions related to {self.name}'s career, background, skills and experience. \
|
| 103 |
+
Your responsibility is to represent {self.name} for interactions on the website as faithfully as possible. \
|
| 104 |
+
You are given a summary of {self.name}'s background and resume which you can use to answer questions. \
|
| 105 |
+
Be professional and engaging, as if talking to a potential client or future employer who came across the website. \
|
| 106 |
+
If you don't know the answer to any question, use your record_unknown_question tool to record the question that you couldn't answer, even if it's about something trivial or unrelated to career. \
|
| 107 |
+
If the user is engaging in discussion, try to steer them towards getting in touch via email; ask for their email and record it using your record_user_details tool. "
|
| 108 |
+
|
| 109 |
+
system_prompt += f"\n\n## Summary:\n{self.summary}\n\n## Resume:\n{self.resume}\n\n"
|
| 110 |
+
system_prompt += f"With this context, please chat with the user, always staying in character as {self.name}."
|
| 111 |
+
return system_prompt
|
| 112 |
+
|
| 113 |
+
def chat(self, message, history):
|
| 114 |
+
messages = [{"role": "system", "content": self.system_prompt()}] + history + [{"role": "user", "content": message}]
|
| 115 |
+
done = False
|
| 116 |
+
while not done:
|
| 117 |
+
response = self.openai.chat.completions.create(model="gpt-4o-mini", messages=messages, tools=tools)
|
| 118 |
+
if response.choices[0].finish_reason=="tool_calls":
|
| 119 |
+
message = response.choices[0].message
|
| 120 |
+
tool_calls = message.tool_calls
|
| 121 |
+
results = self.handle_tool_call(tool_calls)
|
| 122 |
+
messages.append(message)
|
| 123 |
+
messages.extend(results)
|
| 124 |
+
else:
|
| 125 |
+
done = True
|
| 126 |
+
return response.choices[0].message.content
|
| 127 |
+
|
| 128 |
+
|
| 129 |
+
if __name__ == "__main__":
|
| 130 |
+
me = Me()
|
| 131 |
+
gr.ChatInterface(me.chat, type="messages").launch()
|
me/cv.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
**PROFILE**
|
| 2 |
+
|
| 3 |
+
Étudiant en 2e année de cycle ingénieur à l'EMINES School of
|
| 4 |
+
|
| 5 |
+
industrial management a l'UM6P
|
| 6 |
+
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
**EDUCATION**
|
| 10 |
+
|
| 11 |
+
* EMINES - School Of Industrial Management Sept. 2024 - Now (Graduation Sept 2027)
|
| 12 |
+
|
| 13 |
+
Élève ingénieur en management industriel
|
| 14 |
+
|
| 15 |
+
. Projet informatique (Développement d'un système de gestion des employés pour OCP)
|
| 16 |
+
|
| 17 |
+
. Mécanique des milieux continus (Construction d'un dôme en spaghetti, étude mécanique de contraintes)
|
| 18 |
+
|
| 19 |
+
. Biomédical Engineering (Simulation numérique du cycle respiratoire dans l'acinus pulmonaire)
|
| 20 |
+
|
| 21 |
+
. Introduction au management industriel (Developpement d'une strategie d'internationalisation pour une startup IA marocaine, intégrant expansion, gestion de projets, analyse et adaptation aux marchés étrangers.)
|
| 22 |
+
|
| 23 |
+
. Projet VBA - Power BI, créer un excel standardisé pour un client OCP (responsable qualité) pour automatiser le reporting et l'identification de non conformité aux exigences de clients internes et externes.
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
* CPGE Ibn Timiya - Marrakech : 2023 - 2024
|
| 28 |
+
|
| 29 |
+
2" annee des classes préparatoires aux grandes écoles classe MP\*
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
* Lycee Lissane Eddine Ibn Al Khatib - Laayoune : 2022 - 2023
|
| 34 |
+
|
| 35 |
+
1" année des classes préparatoires aux grandes écoles
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
|
| 39 |
+
* Lycee Hassan II - Laayoune
|
| 40 |
+
|
| 41 |
+
Baccalaureat sciences mathématiques option A, mention très bien : 2021 - 2022
|
| 42 |
+
|
| 43 |
+
|
| 44 |
+
|
| 45 |
+
|
| 46 |
+
|
| 47 |
+
**EXPERIENCE**
|
| 48 |
+
|
| 49 |
+
* Stagiaire en observation géologique Région d'Asni: Analyser les formations géologiques et observation des processus géologiques; 14/10/24 - 18/10/24
|
| 50 |
+
* Stage ouvrier en OCP: Stage d'observation du dessalement d'eau de mer et des analyses chimiques en laboratoire industriel; 01/06/25 - 31/06/25
|
| 51 |
+
|
| 52 |
+
|
| 53 |
+
|
| 54 |
+
**CERTIFICATIONS**
|
| 55 |
+
|
| 56 |
+
* Udemy : Machine Learning A-Z: Al, Python Apprentissage et application des modeles de Machine Learning pour analyses prédictives et prise de décision en Python. Obtenu en 25/08/25
|
| 57 |
+
* Udemy : Artificial Intelligence A-Z 2025: Agentic AI, Gen AI, and RL
|
| 58 |
+
* Coursera : Sequential models
|
| 59 |
+
* (Built a decoder-only transformer like chatGPT)
|
| 60 |
+
* Udemy : AI Engineer Agentic Track: The Complete Agent \& MCP Course
|
| 61 |
+
|
| 62 |
+
|
| 63 |
+
|
| 64 |
+
**SKILLS**
|
| 65 |
+
|
| 66 |
+
* Capacité d'apprentissage
|
| 67 |
+
* Adaptabilité et flexibilité
|
| 68 |
+
* Esprit de travail en groupe
|
| 69 |
+
* Machine learning models
|
| 70 |
+
* Agentic AI
|
| 71 |
+
* Python
|
| 72 |
+
* Java
|
| 73 |
+
* MySQL
|
| 74 |
+
* Microsoft office
|
| 75 |
+
* Power BI
|
| 76 |
+
* MS project
|
| 77 |
+
* WBS
|
| 78 |
+
|
| 79 |
+
|
| 80 |
+
|
| 81 |
+
**LANGUAGES**
|
| 82 |
+
|
| 83 |
+
Arabe - langue maternelle
|
| 84 |
+
|
| 85 |
+
Anglais - bilingue
|
| 86 |
+
|
| 87 |
+
Français - niveau intermédiaire
|
| 88 |
+
|
| 89 |
+
|
| 90 |
+
|
| 91 |
+
**ACTIVITÉS PARASCOLAIRES**
|
| 92 |
+
|
| 93 |
+
* Taekwondo : Ceinture noire en taekwondo.
|
| 94 |
+
* Échecs
|
| 95 |
+
* Football
|
| 96 |
+
* Natation
|
me/summary.txt
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
I am Reda, a motivated engineering student in Morocco, currently in the 2nd year of the engineering cycle at EMINES – School of Industrial Management (UM6P), after two years of CPGE MP*. I am highly interested in AI, machine learning and agentic systems, with Udemy certifications in Machine Learning A-Z, AI Engineer Agentic Track, and Artificial Intelligence A-Z, as well as Coursera training in sequential models. I have built a decoder-only transformer (GPT-style) and I am currently following agentic AI coursework. I enjoy learning, adapting, and working in teams, especially on technical and applied projects.
|
| 2 |
+
|
| 3 |
+
At EMINES, I have developed an employee management system for OCP, simulated the respiratory cycle in a pulmonary acinus, designed and analyzed a spaghetti geodesic dome using mechanics of continuous media, created a VBA-Power BI solution to automate OCP quality reporting, and contributed to a strategic internationalization plan for a Moroccan AI startup. My technical skills include Python, Java, MySQL, machine learning models, agentic AI, Microsoft Office, Power BI, MS Project and WBS. I have completed internships in geological observation in Asni and industrial desalination of sea water and laboratory analysis at OCP.
|
| 4 |
+
|
| 5 |
+
I speak Arabic (native), English (bilingual), and French (intermediate). Outside academics, I stay active through swimming, football, and I hold a black belt in Taekwondo. I also enjoy chess and subjects that require precise, mathematical and technical reasoning, and I am curious about how real systems work, from engineering and industrial scheduling to economics, and information dynamics.
|
requirements.txt
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
requests
|
| 2 |
+
python-dotenv
|
| 3 |
+
gradio
|
| 4 |
+
pypdf
|
| 5 |
+
openai
|
| 6 |
+
openai-agents
|