vinesmsuic commited on
Commit
4d8824e
1 Parent(s): dadac55

Revert "load all image models"

Browse files

This reverts commit 525eef9b45c5356092726d46717e185aac9781e2.

Files changed (2) hide show
  1. app.py +2 -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_image_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
- pre_download_all_image_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)
 
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
@@ -1,14 +1,14 @@
1
  from .models import IMAGE_GENERATION_MODELS, IMAGE_EDITION_MODELS, VIDEO_GENERATION_MODELS
2
 
3
- def pre_download_all_image_models():
4
  """
5
- Pre-download all image models to avoid download delay during the first user request
6
  """
7
  imagen_dl_error = pre_download_image_models()
8
  imagedit_dl_error = pre_download_image_models()
9
- #videogen_dl_error = pre_download_video_models()
10
  print("All models downloaded.")
11
- print("Models that encountered download error:", "Image Generation:", imagen_dl_error, "Image Edition:", imagedit_dl_error)#, "Video Generation:", videogen_dl_error)
12
 
13
  def pre_download_image_models():
14
  """
 
1
  from .models import IMAGE_GENERATION_MODELS, IMAGE_EDITION_MODELS, VIDEO_GENERATION_MODELS
2
 
3
+ def pre_download_all_models():
4
  """
5
+ Pre-download all models to avoid download delay during the first user request
6
  """
7
  imagen_dl_error = pre_download_image_models()
8
  imagedit_dl_error = pre_download_image_models()
9
+ videogen_dl_error = pre_download_video_models()
10
  print("All models downloaded.")
11
+ print("Models that encountered download error:", "Image Generation:", imagen_dl_error, "Image Edition:", imagedit_dl_error, "Video Generation:", videogen_dl_error)
12
 
13
  def pre_download_image_models():
14
  """