Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
374537f
1
Parent(s):
c271014
only load video models
Browse files- app.py +2 -2
- model/pre_download.py +4 -4
app.py
CHANGED
|
@@ -7,7 +7,7 @@ from serve.leaderboard import build_leaderboard_tab
|
|
| 7 |
from model.model_manager import ModelManager
|
| 8 |
from pathlib import Path
|
| 9 |
from serve.constants import SERVER_PORT, ROOT_PATH, ELO_RESULTS_DIR
|
| 10 |
-
from model.pre_download import pre_download_all_models
|
| 11 |
|
| 12 |
def build_combine_demo(models, elo_results_file, leaderboard_table_file):
|
| 13 |
|
|
@@ -99,7 +99,7 @@ if __name__ == "__main__":
|
|
| 99 |
elo_results_dir = ELO_RESULTS_DIR
|
| 100 |
models = ModelManager()
|
| 101 |
|
| 102 |
-
|
| 103 |
|
| 104 |
elo_results_file, leaderboard_table_file = load_elo_results(elo_results_dir)
|
| 105 |
demo = build_combine_demo(models, elo_results_file, leaderboard_table_file)
|
|
|
|
| 7 |
from model.model_manager import ModelManager
|
| 8 |
from pathlib import Path
|
| 9 |
from serve.constants import SERVER_PORT, ROOT_PATH, ELO_RESULTS_DIR
|
| 10 |
+
from model.pre_download import pre_download_all_models, pre_download_video_models
|
| 11 |
|
| 12 |
def build_combine_demo(models, elo_results_file, leaderboard_table_file):
|
| 13 |
|
|
|
|
| 99 |
elo_results_dir = ELO_RESULTS_DIR
|
| 100 |
models = ModelManager()
|
| 101 |
|
| 102 |
+
print("Error downloading models:", pre_download_video_models())
|
| 103 |
|
| 104 |
elo_results_file, leaderboard_table_file = load_elo_results(elo_results_dir)
|
| 105 |
demo = build_combine_demo(models, elo_results_file, leaderboard_table_file)
|
model/pre_download.py
CHANGED
|
@@ -19,10 +19,10 @@ def pre_download_image_models():
|
|
| 19 |
for model_string in IMAGE_GENERATION_MODELS:
|
| 20 |
|
| 21 |
model_lib, model_name, model_type = model_string.split("_")
|
| 22 |
-
|
| 23 |
-
|
| 24 |
if model_lib == "imagenhub":
|
| 25 |
try:
|
|
|
|
| 26 |
temp_model = imagen_hub.get_model(model_name) # Forcing model to download weight files
|
| 27 |
del temp_model
|
| 28 |
except Exception as e:
|
|
@@ -42,10 +42,10 @@ def pre_download_image_models():
|
|
| 42 |
for model_string in IMAGE_EDITION_MODELS:
|
| 43 |
|
| 44 |
model_lib, model_name, model_type = model_string.split("_")
|
| 45 |
-
print("Loading image edition model:", model_name)
|
| 46 |
|
| 47 |
if model_lib == "imagenhub":
|
| 48 |
try:
|
|
|
|
| 49 |
temp_model = imagen_hub.get_model(model_name) # Forcing model to download weight files
|
| 50 |
del temp_model
|
| 51 |
except Exception as e:
|
|
@@ -65,10 +65,10 @@ def pre_download_video_models():
|
|
| 65 |
for model_string in VIDEO_GENERATION_MODELS:
|
| 66 |
|
| 67 |
model_lib, model_name, model_type = model_string.split("_")
|
| 68 |
-
print("Loading video generation model:", model_name)
|
| 69 |
|
| 70 |
if model_lib == "videogenhub":
|
| 71 |
try:
|
|
|
|
| 72 |
temp_model = videogen_hub.get_model(model_name) # Forcing model to download weight files
|
| 73 |
del temp_model
|
| 74 |
except Exception as e:
|
|
|
|
| 19 |
for model_string in IMAGE_GENERATION_MODELS:
|
| 20 |
|
| 21 |
model_lib, model_name, model_type = model_string.split("_")
|
| 22 |
+
|
|
|
|
| 23 |
if model_lib == "imagenhub":
|
| 24 |
try:
|
| 25 |
+
print("Loading image generation model:", model_name)
|
| 26 |
temp_model = imagen_hub.get_model(model_name) # Forcing model to download weight files
|
| 27 |
del temp_model
|
| 28 |
except Exception as e:
|
|
|
|
| 42 |
for model_string in IMAGE_EDITION_MODELS:
|
| 43 |
|
| 44 |
model_lib, model_name, model_type = model_string.split("_")
|
|
|
|
| 45 |
|
| 46 |
if model_lib == "imagenhub":
|
| 47 |
try:
|
| 48 |
+
print("Loading image edition model:", model_name)
|
| 49 |
temp_model = imagen_hub.get_model(model_name) # Forcing model to download weight files
|
| 50 |
del temp_model
|
| 51 |
except Exception as e:
|
|
|
|
| 65 |
for model_string in VIDEO_GENERATION_MODELS:
|
| 66 |
|
| 67 |
model_lib, model_name, model_type = model_string.split("_")
|
|
|
|
| 68 |
|
| 69 |
if model_lib == "videogenhub":
|
| 70 |
try:
|
| 71 |
+
print("Loading video generation model:", model_name)
|
| 72 |
temp_model = videogen_hub.get_model(model_name) # Forcing model to download weight files
|
| 73 |
del temp_model
|
| 74 |
except Exception as e:
|