DongfuJiang commited on
Commit
a0eadb6
2 Parent(s): f697bf4 de72fcf

Merge branch 'main' of https://huggingface.co/spaces/TIGER-Lab/GenAI-Arena

Browse files
model/model_manager.py CHANGED
@@ -5,7 +5,7 @@ import requests
5
  import io, base64, json
6
  import spaces
7
  from PIL import Image
8
- from .models import IMAGE_GENERATION_MODELS, IMAGE_EDITION_MODELS, VIDEO_GENERATION_MODELS, MUSEUM_UNSUPPORTED_MODELS, load_pipeline
9
  from .fetch_museum_results import draw_from_imagen_museum, draw2_from_imagen_museum, draw_from_videogen_museum, draw2_from_videogen_museum
10
 
11
  class ModelManager:
@@ -14,6 +14,7 @@ class ModelManager:
14
  self.model_ie_list = IMAGE_EDITION_MODELS
15
  self.model_vg_list = VIDEO_GENERATION_MODELS
16
  self.excluding_model_list = MUSEUM_UNSUPPORTED_MODELS
 
17
  self.loaded_models = {}
18
 
19
  def load_model_pipe(self, model_name):
@@ -196,6 +197,9 @@ class ModelManager:
196
  picking_list = [item for item in self.model_vg_list if item not in self.excluding_model_list]
197
  if model_A == "" and model_B == "":
198
  model_names = random.sample([model for model in picking_list], 2)
 
 
 
199
  else:
200
  model_names = [model_A, model_B]
201
 
 
5
  import io, base64, json
6
  import spaces
7
  from PIL import Image
8
+ from .models import IMAGE_GENERATION_MODELS, IMAGE_EDITION_MODELS, VIDEO_GENERATION_MODELS, MUSEUM_UNSUPPORTED_MODELS, DESIRED_APPEAR_MODEL, load_pipeline
9
  from .fetch_museum_results import draw_from_imagen_museum, draw2_from_imagen_museum, draw_from_videogen_museum, draw2_from_videogen_museum
10
 
11
  class ModelManager:
 
14
  self.model_ie_list = IMAGE_EDITION_MODELS
15
  self.model_vg_list = VIDEO_GENERATION_MODELS
16
  self.excluding_model_list = MUSEUM_UNSUPPORTED_MODELS
17
+ self.desired_model_list = DESIRED_APPEAR_MODEL
18
  self.loaded_models = {}
19
 
20
  def load_model_pipe(self, model_name):
 
197
  picking_list = [item for item in self.model_vg_list if item not in self.excluding_model_list]
198
  if model_A == "" and model_B == "":
199
  model_names = random.sample([model for model in picking_list], 2)
200
+
201
+ #override the random selection
202
+ model_names[random.choice([0, 1])] = random.choice(self.desired_model_list)
203
  else:
204
  model_names = [model_A, model_B]
205
 
model/models/__init__.py CHANGED
@@ -16,12 +16,12 @@ IMAGE_EDITION_MODELS = ['imagenhub_CycleDiffusion_edition', 'imagenhub_Pix2PixZe
16
  'imagenhub_InfEdit_edition', 'imagenhub_CosXLEdit_edition']
17
  VIDEO_GENERATION_MODELS = ['fal_AnimateDiff_text2video',
18
  'fal_AnimateDiffTurbo_text2video',
19
- 'fal_StableVideoDiffusion_text2video',
20
  'videogenhub_LaVie_generation',
21
  'videogenhub_VideoCrafter2_generation',
22
  'videogenhub_ModelScope_generation',
23
- 'videogenhub_OpenSora_generation', 'videogenhub_T2VTurbo_generation']
24
  MUSEUM_UNSUPPORTED_MODELS = ['videogenhub_OpenSoraPlan_generation']
 
25
 
26
  def load_pipeline(model_name):
27
  """
 
16
  'imagenhub_InfEdit_edition', 'imagenhub_CosXLEdit_edition']
17
  VIDEO_GENERATION_MODELS = ['fal_AnimateDiff_text2video',
18
  'fal_AnimateDiffTurbo_text2video',
 
19
  'videogenhub_LaVie_generation',
20
  'videogenhub_VideoCrafter2_generation',
21
  'videogenhub_ModelScope_generation',
22
+ 'videogenhub_OpenSora_generation']
23
  MUSEUM_UNSUPPORTED_MODELS = ['videogenhub_OpenSoraPlan_generation']
24
+ DESIRED_APPEAR_MODEL = ['videogenhub_T2VTurbo_generation','fal_StableVideoDiffusion_text2video']
25
 
26
  def load_pipeline(model_name):
27
  """
requirements.txt CHANGED
@@ -66,8 +66,8 @@ pyav
66
  pyarrow
67
  tensorboard
68
  timm
69
- wandb
70
  pandarallel
 
71
  kaleido
72
 
73
 
 
66
  pyarrow
67
  tensorboard
68
  timm
 
69
  pandarallel
70
+ wandb
71
  kaleido
72
 
73