Spaces:
Running on Zero
Running on Zero
Update app.py
Browse files30 unmodified lines313233343536371626 unmodified lines166416651666166716681669733 unmodified lines24032404240524062407240824092410241130 unmodified linesimport threadingfrom model_config import MODEL_CONFIG1626 unmodified linesbreakrecords[f"{rec['owner']}::{rec['file_key']}"] = recif rec["size_mb"] < WARMUP_MIN_MB:rec.update(state="skipped", progress=1.0)self._flush(plan, records)733 unmodified lines# ==========================================================================from model_config import MODEL_CONFIG, SYNC_FROM_GUI_SPACE# 🌟 Character LoRA 的 title / trigger word 元数据(loras_gallery 的 models.json)LORA_META_URL = "https://huggingface.co/spaces/waveshaker/loras_gallery/resolve/main/models.json"UI_SPACE_URL = MODEL_CONFIG.get("ui_space_url", "").rstrip("/")FRONTEND_CACHE_DIR = ROOT / "frontend_cache" # 🌟 指向新文件夹30 unmodified lines3132333435363738391626 unmodified lines16661667166816691670167116721673167416751676733 unmodified lines24102411241224132414241530 unmodified linesimport threadingfrom model_config import MODEL_CONFIG# ⚠️ 必须在 load_char_loras_from_repo() 之前定义 —— 它内部要读这个常量。# 放在文件后面的"静态挂载"段里会导致启动首次扫描 NameError,触发词全空且被 300s 缓存锁住。LORA_META_URL = "https://huggingface.co/spaces/waveshaker/loras_gallery/resolve/main/models.json"1626 unmodified linesbreakrecords[f"{rec['owner']}::{rec['file_key']}"] = rec# ✅ 预算裁剪:request_sweep() 已判定超预算的记录,直接跳过,别再读if rec.get("state") == "skipped":self._flush(plan, records)continueif rec["size_mb"] < WARMUP_MIN_MB:rec.update(state="skipped", progress=1.0)self._flush(plan, records)733 unmodified lines# ==========================================================================from model_config import MODEL_CONFIG, SYNC_FROM_GUI_SPACEUI_SPACE_URL = MODEL_CONFIG.get("ui_space_url", "").rstrip("/")FRONTEND_CACHE_DIR = ROOT / "frontend_cache" # 🌟 指向新文件夹
app.py+8-4