Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -35,14 +35,25 @@ def llm_generate(prompt: str):
|
|
| 35 |
# ---------------- CORE FEATURES ----------------
|
| 36 |
def add_candidate(name, skills, experience):
|
| 37 |
if not name or not skills:
|
| 38 |
-
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
|
| 40 |
profile = f"Name: {name}\nSkills: {skills}\nExperience: {experience}"
|
| 41 |
vec = embed_text(profile)
|
| 42 |
faiss_index.add(vec)
|
| 43 |
candidates.append(profile)
|
| 44 |
|
| 45 |
-
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
|
| 47 |
def generate_bio(raw_data):
|
| 48 |
prompt = f"""
|
|
|
|
| 35 |
# ---------------- CORE FEATURES ----------------
|
| 36 |
def add_candidate(name, skills, experience):
|
| 37 |
if not name or not skills:
|
| 38 |
+
return (
|
| 39 |
+
"⚠️ Please fill in required fields.",
|
| 40 |
+
gr.update(),
|
| 41 |
+
gr.update(),
|
| 42 |
+
gr.update()
|
| 43 |
+
)
|
| 44 |
|
| 45 |
profile = f"Name: {name}\nSkills: {skills}\nExperience: {experience}"
|
| 46 |
vec = embed_text(profile)
|
| 47 |
faiss_index.add(vec)
|
| 48 |
candidates.append(profile)
|
| 49 |
|
| 50 |
+
return (
|
| 51 |
+
f"✅ Candidate **{name}** added successfully.",
|
| 52 |
+
gr.update(value=""), # clear name
|
| 53 |
+
gr.update(value=""), # clear skills
|
| 54 |
+
gr.update(value="") # clear experience
|
| 55 |
+
)
|
| 56 |
+
|
| 57 |
|
| 58 |
def generate_bio(raw_data):
|
| 59 |
prompt = f"""
|