Spaces:
Running
on
Zero
Running
on
Zero
enable random
Browse files- model/model_manager.py +21 -11
- serve/update_skill.py +2 -1
model/model_manager.py
CHANGED
@@ -70,12 +70,17 @@ class ModelManager:
|
|
70 |
|
71 |
def generate_image_ig_parallel_anony(self, prompt, model_A, model_B, model_C, model_D):
|
72 |
if model_A == "" and model_B == "" and model_C == "" and model_D == "":
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
|
|
|
|
|
|
|
|
|
|
79 |
else:
|
80 |
model_names = [model_A, model_B, model_C, model_D]
|
81 |
|
@@ -90,11 +95,16 @@ class ModelManager:
|
|
90 |
def generate_image_ig_museum_parallel_anony(self, model_A, model_B, model_C, model_D):
|
91 |
if model_A == "" and model_B == "" and model_C == "" and model_D == "":
|
92 |
# model_names = random.sample([model for model in self.model_ig_list], 4)
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
model_names =
|
97 |
-
|
|
|
|
|
|
|
|
|
|
|
98 |
else:
|
99 |
model_names = [model_A, model_B, model_C, model_D]
|
100 |
|
|
|
70 |
|
71 |
def generate_image_ig_parallel_anony(self, prompt, model_A, model_B, model_C, model_D):
|
72 |
if model_A == "" and model_B == "" and model_C == "" and model_D == "":
|
73 |
+
not_run = [11, 12, 13, 14, 15, 16, 17, 18, 19]
|
74 |
+
filtered_models = [model for i, model in enumerate(self.model_ig_list) if i not in not_run]
|
75 |
+
model_names = random.sample([model for model in filtered_models], 4)
|
76 |
+
|
77 |
+
|
78 |
+
|
79 |
+
# from .matchmaker import matchmaker
|
80 |
+
# model_ids = matchmaker(num_players=len(self.model_ig_list))
|
81 |
+
# print(model_ids)
|
82 |
+
# model_names = [self.model_ig_list[i] for i in model_ids]
|
83 |
+
# print(model_names)
|
84 |
else:
|
85 |
model_names = [model_A, model_B, model_C, model_D]
|
86 |
|
|
|
95 |
def generate_image_ig_museum_parallel_anony(self, model_A, model_B, model_C, model_D):
|
96 |
if model_A == "" and model_B == "" and model_C == "" and model_D == "":
|
97 |
# model_names = random.sample([model for model in self.model_ig_list], 4)
|
98 |
+
|
99 |
+
not_run = [11, 12, 13, 14, 15, 16, 17, 18, 19]
|
100 |
+
filtered_models = [model for i, model in enumerate(self.model_ig_list) if i not in not_run]
|
101 |
+
model_names = random.sample([model for model in filtered_models], 4)
|
102 |
+
|
103 |
+
# from .matchmaker import matchmaker
|
104 |
+
# model_ids = matchmaker(num_players=len(self.model_ig_list))
|
105 |
+
# print(model_ids)
|
106 |
+
# model_names = [self.model_ig_list[i] for i in model_ids]
|
107 |
+
# print(model_names)
|
108 |
else:
|
109 |
model_names = [model_A, model_B, model_C, model_D]
|
110 |
|
serve/update_skill.py
CHANGED
@@ -82,6 +82,7 @@ def update_skill(rank, model_names, k_group=4):
|
|
82 |
|
83 |
ratings, comparison_counts, total_comparisons = load_json_via_sftp()
|
84 |
|
|
|
85 |
# group = Model_ID.group
|
86 |
group = []
|
87 |
for model_name in model_names:
|
@@ -101,7 +102,7 @@ def update_skill(rank, model_names, k_group=4):
|
|
101 |
|
102 |
comparison_counts[group[player1], group[player2]] += 1
|
103 |
comparison_counts[group[player2], group[player1]] += 1
|
104 |
-
|
105 |
total_comparisons += 1
|
106 |
|
107 |
save_json_via_sftp(ratings, comparison_counts, total_comparisons)
|
|
|
82 |
|
83 |
ratings, comparison_counts, total_comparisons = load_json_via_sftp()
|
84 |
|
85 |
+
'''
|
86 |
# group = Model_ID.group
|
87 |
group = []
|
88 |
for model_name in model_names:
|
|
|
102 |
|
103 |
comparison_counts[group[player1], group[player2]] += 1
|
104 |
comparison_counts[group[player2], group[player1]] += 1
|
105 |
+
'''
|
106 |
total_comparisons += 1
|
107 |
|
108 |
save_json_via_sftp(ratings, comparison_counts, total_comparisons)
|