Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -100,7 +100,6 @@ def filter_by_roles(category_name):
|
|
| 100 |
def llm_recommendations(category_name):
|
| 101 |
job_titles = CATEGORIES[category_name]
|
| 102 |
|
| 103 |
-
# Read filtered candidates from CSV
|
| 104 |
if not os.path.exists(FILTERED_CSV):
|
| 105 |
return pd.DataFrame(), None
|
| 106 |
|
|
@@ -116,16 +115,22 @@ def llm_recommendations(category_name):
|
|
| 116 |
for i in range(0, len(filtered_candidates), BATCH_SIZE):
|
| 117 |
batch = filtered_candidates[i:i+BATCH_SIZE]
|
| 118 |
for person in batch:
|
| 119 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 120 |
response = call_llm(candidate_str, category_name, tuple(job_titles))
|
| 121 |
-
if "
|
| 122 |
recommended.append(person)
|
| 123 |
|
| 124 |
if not recommended:
|
| 125 |
return pd.DataFrame(), None
|
| 126 |
|
| 127 |
df_rec = pd.DataFrame(recommended)
|
| 128 |
-
# Sort by
|
| 129 |
def parse_salary(s):
|
| 130 |
try:
|
| 131 |
return float(s.replace("$","").replace(",",""))
|
|
|
|
| 100 |
def llm_recommendations(category_name):
|
| 101 |
job_titles = CATEGORIES[category_name]
|
| 102 |
|
|
|
|
| 103 |
if not os.path.exists(FILTERED_CSV):
|
| 104 |
return pd.DataFrame(), None
|
| 105 |
|
|
|
|
| 115 |
for i in range(0, len(filtered_candidates), BATCH_SIZE):
|
| 116 |
batch = filtered_candidates[i:i+BATCH_SIZE]
|
| 117 |
for person in batch:
|
| 118 |
+
# Only send necessary info
|
| 119 |
+
candidate_info = {
|
| 120 |
+
"Name": person.get("Name"),
|
| 121 |
+
"Roles": person.get("Roles"),
|
| 122 |
+
"Skills": person.get("Skills")
|
| 123 |
+
}
|
| 124 |
+
candidate_str = json.dumps(candidate_info)
|
| 125 |
response = call_llm(candidate_str, category_name, tuple(job_titles))
|
| 126 |
+
if response.strip().lower().startswith("yes"):
|
| 127 |
recommended.append(person)
|
| 128 |
|
| 129 |
if not recommended:
|
| 130 |
return pd.DataFrame(), None
|
| 131 |
|
| 132 |
df_rec = pd.DataFrame(recommended)
|
| 133 |
+
# Sort by numeric salary
|
| 134 |
def parse_salary(s):
|
| 135 |
try:
|
| 136 |
return float(s.replace("$","").replace(",",""))
|