Spaces:
Running
on
Zero
Running
on
Zero
Upload folder using huggingface_hub
Browse files- app.py +6 -2
- core/model_manager.py +0 -1
app.py
CHANGED
|
@@ -73,14 +73,18 @@ def main():
|
|
| 73 |
load_ipadapter_presets
|
| 74 |
)
|
| 75 |
from core import shared_state
|
| 76 |
-
from core.settings import ALL_MODEL_MAP
|
| 77 |
|
| 78 |
def check_all_model_urls_on_startup():
|
| 79 |
print("--- [Setup] Checking all model URL validity (one-time check) ---")
|
| 80 |
for display_name, model_info in ALL_MODEL_MAP.items():
|
| 81 |
repo_id, filename, _, _ = model_info
|
| 82 |
if not repo_id: continue
|
| 83 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 84 |
try:
|
| 85 |
response = requests.head(url, timeout=5, allow_redirects=True)
|
| 86 |
if response.status_code >= 400:
|
|
|
|
| 73 |
load_ipadapter_presets
|
| 74 |
)
|
| 75 |
from core import shared_state
|
| 76 |
+
from core.settings import ALL_MODEL_MAP, ALL_FILE_DOWNLOAD_MAP
|
| 77 |
|
| 78 |
def check_all_model_urls_on_startup():
|
| 79 |
print("--- [Setup] Checking all model URL validity (one-time check) ---")
|
| 80 |
for display_name, model_info in ALL_MODEL_MAP.items():
|
| 81 |
repo_id, filename, _, _ = model_info
|
| 82 |
if not repo_id: continue
|
| 83 |
+
|
| 84 |
+
download_info = ALL_FILE_DOWNLOAD_MAP.get(filename, {})
|
| 85 |
+
repo_file_path = download_info.get('repository_file_path', filename)
|
| 86 |
+
url = f"https://huggingface.co/{repo_id}/resolve/main/{repo_file_path}"
|
| 87 |
+
|
| 88 |
try:
|
| 89 |
response = requests.head(url, timeout=5, allow_redirects=True)
|
| 90 |
if response.status_code >= 400:
|
core/model_manager.py
CHANGED
|
@@ -127,7 +127,6 @@ class ModelManager:
|
|
| 127 |
strength_model=lora_info["strength_model"],
|
| 128 |
strength_clip=lora_info["strength_clip"]
|
| 129 |
)
|
| 130 |
-
print(f" -> Applied LoRA: {lora_info['lora_name']}")
|
| 131 |
|
| 132 |
loaded_model_data = (patched_model, patched_clip, loaded_model_data[2])
|
| 133 |
print(f"--- [ModelManager] ✅ All LoRAs merged into the model on CPU. ---")
|
|
|
|
| 127 |
strength_model=lora_info["strength_model"],
|
| 128 |
strength_clip=lora_info["strength_clip"]
|
| 129 |
)
|
|
|
|
| 130 |
|
| 131 |
loaded_model_data = (patched_model, patched_clip, loaded_model_data[2])
|
| 132 |
print(f"--- [ModelManager] ✅ All LoRAs merged into the model on CPU. ---")
|