Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -696,24 +696,39 @@ with gr.Blocks(title="Axon v6") as demo:
|
|
| 696 |
print("🔥 Axon v6 starting...")
|
| 697 |
print("⬇️ Pre-downloading all models...")
|
| 698 |
|
| 699 |
-
|
| 700 |
-
|
| 701 |
-
|
|
|
|
|
|
|
| 702 |
model_path = os.path.join(MODELS_DIR, filename)
|
| 703 |
|
| 704 |
-
if
|
|
|
|
|
|
|
|
|
|
| 705 |
repo_id = MODEL_REPOS.get(filename)
|
|
|
|
|
|
|
| 706 |
if repo_id:
|
| 707 |
-
print(f"⬇️ Downloading {filename}...")
|
| 708 |
try:
|
|
|
|
| 709 |
hf_hub_download(repo_id=repo_id, filename=filename, local_dir=MODELS_DIR)
|
| 710 |
-
print(f"✅
|
|
|
|
| 711 |
except Exception as e:
|
| 712 |
-
print(f"❌
|
| 713 |
-
|
| 714 |
-
|
|
|
|
|
|
|
| 715 |
|
| 716 |
-
print("
|
| 717 |
-
print("
|
|
|
|
|
|
|
|
|
|
|
|
|
| 718 |
|
|
|
|
| 719 |
demo.launch(server_name="0.0.0.0", server_port=7860, theme=gr.themes.Soft(primary_hue="indigo"))
|
|
|
|
| 696 |
print("🔥 Axon v6 starting...")
|
| 697 |
print("⬇️ Pre-downloading all models...")
|
| 698 |
|
| 699 |
+
download_results = {}
|
| 700 |
+
|
| 701 |
+
for model_name, filename in MODELS.items():
|
| 702 |
+
print(f"\n📥 Checking: {model_name}")
|
| 703 |
+
print(f" Filename: {filename}")
|
| 704 |
model_path = os.path.join(MODELS_DIR, filename)
|
| 705 |
|
| 706 |
+
if os.path.exists(model_path):
|
| 707 |
+
print(f" ✅ Already cached")
|
| 708 |
+
download_results[model_name] = "cached"
|
| 709 |
+
else:
|
| 710 |
repo_id = MODEL_REPOS.get(filename)
|
| 711 |
+
print(f" Repo: {repo_id}")
|
| 712 |
+
|
| 713 |
if repo_id:
|
|
|
|
| 714 |
try:
|
| 715 |
+
print(f" ⬇️ Downloading...")
|
| 716 |
hf_hub_download(repo_id=repo_id, filename=filename, local_dir=MODELS_DIR)
|
| 717 |
+
print(f" ✅ Downloaded!")
|
| 718 |
+
download_results[model_name] = "downloaded"
|
| 719 |
except Exception as e:
|
| 720 |
+
print(f" ❌ FAILED: {e}")
|
| 721 |
+
download_results[model_name] = f"failed: {e}"
|
| 722 |
+
else:
|
| 723 |
+
print(f" ❌ No repo configured!")
|
| 724 |
+
download_results[model_name] = "no repo"
|
| 725 |
|
| 726 |
+
print("\n" + "="*50)
|
| 727 |
+
print("📊 DOWNLOAD SUMMARY:")
|
| 728 |
+
for model, status in download_results.items():
|
| 729 |
+
emoji = "✅" if status in ["cached", "downloaded"] else "❌"
|
| 730 |
+
print(f" {emoji} {model}: {status}")
|
| 731 |
+
print("="*50 + "\n")
|
| 732 |
|
| 733 |
+
print("🚀 Launching Axon...")
|
| 734 |
demo.launch(server_name="0.0.0.0", server_port=7860, theme=gr.themes.Soft(primary_hue="indigo"))
|