Spaces:
Running on Zero
Running on Zero
Commit ·
dfd60a2
1
Parent(s): 1ccbddf
fix: normalize compact quest aliases
Browse filesCo-authored-by: Codex <codex@openai.com>
- README.md +5 -3
- hackathon_advisor/quest_taxonomy.py +6 -0
- tests/test_dashboard.py +48 -0
README.md
CHANGED
|
@@ -142,9 +142,10 @@ be a normal directory such as `.cache/advisor-dashboard`. Each refresh writes
|
|
| 142 |
updates `latest.json` through an atomic swap. Quest analysis is cached per project using the metadata-first inference
|
| 143 |
prompt hash, taxonomy hash, MiniCPM model id, adapter id/revision, local adapter digest, and generation config.
|
| 144 |
|
| 145 |
-
The app
|
| 146 |
-
|
| 147 |
-
|
|
|
|
| 148 |
|
| 149 |
## Models And Data
|
| 150 |
|
|
@@ -303,6 +304,7 @@ ADVISOR_QUEST_ANALYZER_BACKEND=minicpm-transformers
|
|
| 303 |
ADVISOR_QUEST_ADAPTER_ID=build-small-hackathon/hackathon-advisor-quest-minicpm5-lora
|
| 304 |
ADVISOR_QUEST_ANALYSIS_BATCH_SIZE=8
|
| 305 |
ADVISOR_CACHE_DIR=/data/advisor-cache
|
|
|
|
| 306 |
ADVISOR_REFRESH_COMPUTE=cpu
|
| 307 |
ADVISOR_SCHEDULED_REFRESH_COMPUTE=cpu
|
| 308 |
ADVISOR_REFRESH_INTERVAL_SECONDS=3600
|
|
|
|
| 142 |
updates `latest.json` through an atomic swap. Quest analysis is cached per project using the metadata-first inference
|
| 143 |
prompt hash, taxonomy hash, MiniCPM model id, adapter id/revision, local adapter digest, and generation config.
|
| 144 |
|
| 145 |
+
The app can start an hourly scheduler when `ADVISOR_CACHE_DIR` is configured. The submitted Space keeps scheduled
|
| 146 |
+
refresh disabled and updates the mounted bucket from local builds, so index construction and quest analysis do not run
|
| 147 |
+
inside the public demo runtime. Manual and scheduled refreshes still acquire `$ADVISOR_CACHE_DIR/refresh.lock`,
|
| 148 |
+
heartbeat while active, and leave the current validated dashboard in place if a new run fails validation.
|
| 149 |
|
| 150 |
## Models And Data
|
| 151 |
|
|
|
|
| 304 |
ADVISOR_QUEST_ADAPTER_ID=build-small-hackathon/hackathon-advisor-quest-minicpm5-lora
|
| 305 |
ADVISOR_QUEST_ANALYSIS_BATCH_SIZE=8
|
| 306 |
ADVISOR_CACHE_DIR=/data/advisor-cache
|
| 307 |
+
ADVISOR_DISABLE_SCHEDULED_REFRESH=1
|
| 308 |
ADVISOR_REFRESH_COMPUTE=cpu
|
| 309 |
ADVISOR_SCHEDULED_REFRESH_COMPUTE=cpu
|
| 310 |
ADVISOR_REFRESH_INTERVAL_SECONDS=3600
|
hackathon_advisor/quest_taxonomy.py
CHANGED
|
@@ -172,6 +172,12 @@ _QUEST_ALIASES.update(
|
|
| 172 |
_quest_key("OpenAI Codex"): "Codex",
|
| 173 |
_quest_key("OpenAI"): "Codex",
|
| 174 |
_quest_key("Codex"): "Codex",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 175 |
_quest_key("Small model <=4B"): "Tiny Titan",
|
| 176 |
_quest_key("Small model under 4B"): "Tiny Titan",
|
| 177 |
_quest_key("Shareable output"): "Sharing is Caring",
|
|
|
|
| 172 |
_quest_key("OpenAI Codex"): "Codex",
|
| 173 |
_quest_key("OpenAI"): "Codex",
|
| 174 |
_quest_key("Codex"): "Codex",
|
| 175 |
+
_quest_key("Offbrand"): "Off-Brand",
|
| 176 |
+
_quest_key("Offgrid"): "Off the Grid",
|
| 177 |
+
_quest_key("Llama Champion badge"): "Llama Champion",
|
| 178 |
+
_quest_key("Modal first"): "Modal",
|
| 179 |
+
_quest_key("Nemotron 3 Nano 4B"): "Nemotron",
|
| 180 |
+
_quest_key("Nemotron Mini 4B"): "Nemotron",
|
| 181 |
_quest_key("Small model <=4B"): "Tiny Titan",
|
| 182 |
_quest_key("Small model under 4B"): "Tiny Titan",
|
| 183 |
_quest_key("Shareable output"): "Sharing is Caring",
|
tests/test_dashboard.py
CHANGED
|
@@ -308,6 +308,54 @@ def test_quest_analysis_validation_accepts_best_use_of_known_labels() -> None:
|
|
| 308 |
assert validated.matches_by_project[projects[0].id][0]["quest"] == "Modal"
|
| 309 |
|
| 310 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 311 |
def test_quest_analysis_validation_rejects_unknown_composite_quest_labels() -> None:
|
| 312 |
projects = fake_projects(1)
|
| 313 |
raw = {
|
|
|
|
| 308 |
assert validated.matches_by_project[projects[0].id][0]["quest"] == "Modal"
|
| 309 |
|
| 310 |
|
| 311 |
+
def test_quest_analysis_validation_accepts_common_compact_aliases() -> None:
|
| 312 |
+
projects = fake_projects(1)
|
| 313 |
+
raw = {
|
| 314 |
+
"projects": [
|
| 315 |
+
{
|
| 316 |
+
"project_id": projects[0].id,
|
| 317 |
+
"matches": [
|
| 318 |
+
{
|
| 319 |
+
"quest": "Offbrand",
|
| 320 |
+
"confidence": 0.84,
|
| 321 |
+
"evidence": "custom frontend",
|
| 322 |
+
"source": "readme",
|
| 323 |
+
},
|
| 324 |
+
{
|
| 325 |
+
"quest": "Offgrid",
|
| 326 |
+
"confidence": 0.82,
|
| 327 |
+
"evidence": "loads weights locally",
|
| 328 |
+
"source": "app_file",
|
| 329 |
+
},
|
| 330 |
+
{
|
| 331 |
+
"quest": "Llama Champion badge",
|
| 332 |
+
"confidence": 0.8,
|
| 333 |
+
"evidence": "llama-cpp-python",
|
| 334 |
+
"source": "app_file",
|
| 335 |
+
},
|
| 336 |
+
{
|
| 337 |
+
"quest": "Modal-first",
|
| 338 |
+
"confidence": 0.79,
|
| 339 |
+
"evidence": "Modal serverless GPUs",
|
| 340 |
+
"source": "readme",
|
| 341 |
+
},
|
| 342 |
+
{
|
| 343 |
+
"quest": "Nemotron-3 Nano 4B",
|
| 344 |
+
"confidence": 0.78,
|
| 345 |
+
"evidence": "Nemotron 3 Nano 4B",
|
| 346 |
+
"source": "readme",
|
| 347 |
+
},
|
| 348 |
+
],
|
| 349 |
+
}
|
| 350 |
+
]
|
| 351 |
+
}
|
| 352 |
+
|
| 353 |
+
validated = validate_quest_analysis_payload(raw, projects, source="fake")
|
| 354 |
+
|
| 355 |
+
quests = [match["quest"] for match in validated.matches_by_project[projects[0].id]]
|
| 356 |
+
assert quests == ["Off-Brand", "Off the Grid", "Llama Champion", "Modal", "Nemotron"]
|
| 357 |
+
|
| 358 |
+
|
| 359 |
def test_quest_analysis_validation_rejects_unknown_composite_quest_labels() -> None:
|
| 360 |
projects = fake_projects(1)
|
| 361 |
raw = {
|