Harvester: skip repositories without weight files instead of aborting the scan
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2 changed files +7 −1
modified
server/llm_api/downloads.py
+2 −0
@@ -72,6 +72,8 @@ def pick_gguf_files(files: list[dict], preferred: str | None = None) -> list[dic | ||
| 72 | 72 | for base, fs in groups.items(): |
| 73 | 73 | if want in base.upper(): |
| 74 | 74 | return sorted(fs, key=lambda f: f["path"]) + mmproj[:1] |
| 75 | + if not groups: | |
| 76 | + return [] | |
| 75 | 77 | base = sorted(groups.items(), key=lambda kv: sum(f["size"] or 0 for f in kv[1]))[0] |
| 76 | 78 | return sorted(base[1], key=lambda f: f["path"]) + mmproj[:1] |
| 77 | 79 | |
modified
server/llm_api/harvester.py
+5 −1
@@ -161,7 +161,11 @@ class Harvester: | ||
| 161 | 161 | "reasoning" if task_flags["reasoning"] else "general") |
| 162 | 162 | if tasks and task not in tasks and not (task_flags.get(next(iter(tasks), ""), False)): |
| 163 | 163 | continue |
| 164 | − row = await self._evaluate(c, name, family, task, task_flags, budget, absolute, max_ram) | |
| 164 | + try: | |
| 165 | + row = await self._evaluate(c, name, family, task, task_flags, budget, absolute, max_ram) | |
| 166 | + except Exception as e: # one bad repo must not abort the harvest | |
| 167 | + log.warning("harvest: skipping %s (%s: %s)", c["repo"], type(e).__name__, e) | |
| 168 | + continue | |
| 165 | 169 | if not row: |
| 166 | 170 | continue |
| 167 | 171 | row["installed"] = int(c["repo"] in installed or row["base_model"] in installed_keys) |
| 168 | 172 | |