ksort commited on
Commit
afa1318
1 Parent(s): 556c86a

Update ssh

Browse files
model/matchmaker.py CHANGED
@@ -76,6 +76,9 @@ def load_json_via_sftp():
76
  return ratings, comparison_counts, total_comparisons
77
 
78
 
 
 
 
79
  def matchmaker(num_players, k_group=4):
80
  trueskill_env = TrueSkill()
81
 
@@ -86,14 +89,18 @@ def matchmaker(num_players, k_group=4):
86
 
87
  # Randomly select a player
88
  # selected_player = np.random.randint(0, num_players)
 
89
  selected_player = np.argmin(comparison_counts.sum(axis=1))
90
 
 
 
 
91
  selected_trueskill_score = trueskill_env.expose(ratings[selected_player])
92
  trueskill_scores = np.array([trueskill_env.expose(p) for p in ratings])
93
  trueskill_diff = np.abs(trueskill_scores - selected_trueskill_score)
94
  n = comparison_counts[selected_player]
95
  ucb_scores = ucb_score(trueskill_diff, total_comparisons, n)
96
-
97
  # Exclude self, select opponent with highest UCB score
98
  ucb_scores[selected_player] = -float('inf') # minimize the score for the selected player to exclude it
99
  opponents = np.argsort(ucb_scores)[-k_group + 1:].tolist()
 
76
  return ratings, comparison_counts, total_comparisons
77
 
78
 
79
+ class RunningPivot(object):
80
+ running_pivot = []
81
+
82
  def matchmaker(num_players, k_group=4):
83
  trueskill_env = TrueSkill()
84
 
 
89
 
90
  # Randomly select a player
91
  # selected_player = np.random.randint(0, num_players)
92
+ comparison_counts[:, RunningPivot.running_pivot] = float('inf')
93
  selected_player = np.argmin(comparison_counts.sum(axis=1))
94
 
95
+ RunningPivot.running_pivot.append(selected_player)
96
+ RunningPivot.running_pivot = RunningPivot.running_pivot[-5:]
97
+
98
  selected_trueskill_score = trueskill_env.expose(ratings[selected_player])
99
  trueskill_scores = np.array([trueskill_env.expose(p) for p in ratings])
100
  trueskill_diff = np.abs(trueskill_scores - selected_trueskill_score)
101
  n = comparison_counts[selected_player]
102
  ucb_scores = ucb_score(trueskill_diff, total_comparisons, n)
103
+
104
  # Exclude self, select opponent with highest UCB score
105
  ucb_scores[selected_player] = -float('inf') # minimize the score for the selected player to exclude it
106
  opponents = np.argsort(ucb_scores)[-k_group + 1:].tolist()
serve/gradio_web.py CHANGED
@@ -222,7 +222,6 @@ def build_side_by_side_ui_anony(models):
222
  # share_btn = gr.Button(value="📷 Share")
223
 
224
  #gr.Markdown(acknowledgment_md, elem_id="ack_markdown")
225
-
226
  dummy_img_output = gr.Image(width=512, visible=False)
227
  gr.Examples(
228
  examples=[["A train crossing a bridge that is going over a body of water.", os.path.join("./examples", "example1.jpg")],
@@ -231,12 +230,10 @@ def build_side_by_side_ui_anony(models):
231
  ["The bathroom with green tile and a red shower curtain.", os.path.join("./examples", "example4.jpg")]],
232
  inputs = [textbox, dummy_img_output])
233
 
234
- # vote_list = [Top1_btn, Top2_btn, Top3_btn, Top4_btn, Revote_btn, Submit_btn]
235
  order_btn_list = [textbox, send_btn, draw_btn, clear_btn]
236
  vote_order_list = [leftvote_btn, left1vote_btn, rightvote_btn, right1vote_btn, tie_btn, \
237
  A1_btn, A2_btn, A3_btn, A4_btn, B1_btn, B2_btn, B3_btn, B4_btn, C1_btn, C2_btn, C3_btn, C4_btn, D1_btn, D2_btn, D3_btn, D4_btn, \
238
  vote_textbox, vote_submit_btn, vote_mode_btn]
239
- # vote_rank_list = [A1_btn, A2_btn, A3_btn, A4_btn, B1_btn, B2_btn, B3_btn, B4_btn, C1_btn, C2_btn, C3_btn, C4_btn, D1_btn, D2_btn, D3_btn, D4_btn]
240
 
241
  generate_ig0 = gr.Image(width=512, label = "generate A", visible=False, interactive=False)
242
  generate_ig1 = gr.Image(width=512, label = "generate B", visible=False, interactive=False)
 
222
  # share_btn = gr.Button(value="📷 Share")
223
 
224
  #gr.Markdown(acknowledgment_md, elem_id="ack_markdown")
 
225
  dummy_img_output = gr.Image(width=512, visible=False)
226
  gr.Examples(
227
  examples=[["A train crossing a bridge that is going over a body of water.", os.path.join("./examples", "example1.jpg")],
 
230
  ["The bathroom with green tile and a red shower curtain.", os.path.join("./examples", "example4.jpg")]],
231
  inputs = [textbox, dummy_img_output])
232
 
 
233
  order_btn_list = [textbox, send_btn, draw_btn, clear_btn]
234
  vote_order_list = [leftvote_btn, left1vote_btn, rightvote_btn, right1vote_btn, tie_btn, \
235
  A1_btn, A2_btn, A3_btn, A4_btn, B1_btn, B2_btn, B3_btn, B4_btn, C1_btn, C2_btn, C3_btn, C4_btn, D1_btn, D2_btn, D3_btn, D4_btn, \
236
  vote_textbox, vote_submit_btn, vote_mode_btn]
 
237
 
238
  generate_ig0 = gr.Image(width=512, label = "generate A", visible=False, interactive=False)
239
  generate_ig1 = gr.Image(width=512, label = "generate B", visible=False, interactive=False)
serve/update_skill.py CHANGED
@@ -104,4 +104,8 @@ def update_skill(rank, model_names, k_group=4):
104
 
105
  total_comparisons += 1
106
 
107
- save_json_via_sftp(ratings, comparison_counts, total_comparisons)
 
 
 
 
 
104
 
105
  total_comparisons += 1
106
 
107
+ save_json_via_sftp(ratings, comparison_counts, total_comparisons)
108
+
109
+ from model.matchmaker import RunningPivot
110
+ if group[0] in RunningPivot.running_pivot:
111
+ RunningPivot.running_pivot.remove(group[0])
sorted_score_list.json CHANGED
@@ -1,180 +1,180 @@
1
  {
2
  "total_models": 27,
3
- "total_votes": 595,
4
  "sorted_score_list": [
5
  {
6
  "Rank": 0,
7
  "\ud83e\udd16 Model": "Midjourney-v6.0",
8
- "\u2b50 Score (\u03bc/\u03c3)": "31.37 (34.23/0.95)",
9
- "\ud83d\uddf3\ufe0f Votes": 105.0,
10
  "Organization": "Midjourney"
11
  },
12
  {
13
  "Rank": 1,
14
  "\ud83e\udd16 Model": "Midjourney-v5.0",
15
- "\u2b50 Score (\u03bc/\u03c3)": "31.06 (33.85/0.93)",
16
- "\ud83d\uddf3\ufe0f Votes": 108.0,
17
  "Organization": "Midjourney"
18
  },
19
  {
20
  "Rank": 2,
21
  "\ud83e\udd16 Model": "SD-v3.0",
22
- "\u2b50 Score (\u03bc/\u03c3)": "29.34 (31.72/0.79)",
23
- "\ud83d\uddf3\ufe0f Votes": 354.0,
24
  "Organization": "Stability AI"
25
  },
26
  {
27
  "Rank": 3,
28
  "\ud83e\udd16 Model": "Dalle-3",
29
- "\u2b50 Score (\u03bc/\u03c3)": "29.11 (31.51/0.8)",
30
- "\ud83d\uddf3\ufe0f Votes": 225.0,
31
  "Organization": "OpenAI"
32
  },
33
  {
34
  "Rank": 4,
35
- "\ud83e\udd16 Model": "Pixart-Sigma",
36
- "\u2b50 Score (\u03bc/\u03c3)": "26.26 (28.63/0.79)",
37
- "\ud83d\uddf3\ufe0f Votes": 405.0,
38
- "Organization": "PixArt-Alpha"
39
  },
40
  {
41
  "Rank": 5,
 
 
 
 
 
 
 
42
  "\ud83e\udd16 Model": "Open-Dalle-v1.1",
43
  "\u2b50 Score (\u03bc/\u03c3)": "25.84 (28.19/0.78)",
44
  "\ud83d\uddf3\ufe0f Votes": 351.0,
45
  "Organization": "DataAutoGPT3"
46
  },
47
  {
48
- "Rank": 6,
49
- "\ud83e\udd16 Model": "Proteus-v0.2",
50
- "\u2b50 Score (\u03bc/\u03c3)": "25.83 (28.19/0.79)",
51
- "\ud83d\uddf3\ufe0f Votes": 327.0,
52
- "Organization": "DataAutoGPT3"
53
  },
54
  {
55
- "Rank": 7,
56
  "\ud83e\udd16 Model": "Deepfloyd-IF",
57
- "\u2b50 Score (\u03bc/\u03c3)": "25.49 (27.85/0.79)",
58
- "\ud83d\uddf3\ufe0f Votes": 294.0,
59
  "Organization": "DeepFloyd"
60
  },
61
  {
62
- "Rank": 8,
63
  "\ud83e\udd16 Model": "Realvisxl-v2.0",
64
- "\u2b50 Score (\u03bc/\u03c3)": "25.03 (27.39/0.79)",
65
- "\ud83d\uddf3\ufe0f Votes": 312.0,
66
  "Organization": "Realistic Vision"
67
  },
68
- {
69
- "Rank": 9,
70
- "\ud83e\udd16 Model": "Kandinsky-v2.2",
71
- "\u2b50 Score (\u03bc/\u03c3)": "24.97 (27.35/0.79)",
72
- "\ud83d\uddf3\ufe0f Votes": 282.0,
73
- "Organization": "AI-Forever"
74
- },
75
  {
76
  "Rank": 10,
77
- "\ud83e\udd16 Model": "Dreamshaper-xl",
78
- "\u2b50 Score (\u03bc/\u03c3)": "24.73 (27.09/0.79)",
79
- "\ud83d\uddf3\ufe0f Votes": 300.0,
80
- "Organization": "Lykon"
81
  },
82
  {
83
  "Rank": 11,
84
- "\ud83e\udd16 Model": "Dalle-2",
85
- "\u2b50 Score (\u03bc/\u03c3)": "23.84 (26.23/0.8)",
86
- "\ud83d\uddf3\ufe0f Votes": 207.0,
87
- "Organization": "OpenAI"
88
  },
89
  {
90
  "Rank": 12,
91
- "\ud83e\udd16 Model": "Realvisxl-v3.0",
92
- "\u2b50 Score (\u03bc/\u03c3)": "22.71 (25.09/0.79)",
93
- "\ud83d\uddf3\ufe0f Votes": 261.0,
94
- "Organization": "Realistic Vision"
95
  },
96
  {
97
  "Rank": 13,
98
- "\ud83e\udd16 Model": "SDXL-turbo",
99
- "\u2b50 Score (\u03bc/\u03c3)": "21.4 (23.79/0.8)",
100
- "\ud83d\uddf3\ufe0f Votes": 243.0,
101
- "Organization": "Stability AI"
102
  },
103
  {
104
  "Rank": 14,
105
- "\ud83e\udd16 Model": "LCM-v1.5",
106
- "\u2b50 Score (\u03bc/\u03c3)": "20.74 (23.12/0.79)",
107
- "\ud83d\uddf3\ufe0f Votes": 243.0,
108
- "Organization": "Tsinghua"
109
  },
110
  {
111
  "Rank": 15,
112
- "\ud83e\udd16 Model": "Kandinsky-v2.0",
113
- "\u2b50 Score (\u03bc/\u03c3)": "20.49 (22.89/0.8)",
114
- "\ud83d\uddf3\ufe0f Votes": 225.0,
115
- "Organization": "AI-Forever"
116
  },
117
  {
118
  "Rank": 16,
119
  "\ud83e\udd16 Model": "Openjourney-v4",
120
- "\u2b50 Score (\u03bc/\u03c3)": "19.22 (21.64/0.81)",
121
- "\ud83d\uddf3\ufe0f Votes": 225.0,
122
  "Organization": "Prompthero"
123
  },
124
  {
125
  "Rank": 17,
126
- "\ud83e\udd16 Model": "SD-v2.1",
127
- "\u2b50 Score (\u03bc/\u03c3)": "18.8 (21.24/0.81)",
128
- "\ud83d\uddf3\ufe0f Votes": 225.0,
129
  "Organization": "Stability AI"
130
  },
131
  {
132
  "Rank": 18,
133
  "\ud83e\udd16 Model": "Playground-v2.5",
134
- "\u2b50 Score (\u03bc/\u03c3)": "18.54 (20.99/0.81)",
135
- "\ud83d\uddf3\ufe0f Votes": 213.0,
136
  "Organization": "Playground AI"
137
  },
138
  {
139
  "Rank": 19,
140
- "\ud83e\udd16 Model": "SD-turbo",
141
- "\u2b50 Score (\u03bc/\u03c3)": "17.8 (20.26/0.82)",
142
- "\ud83d\uddf3\ufe0f Votes": 204.0,
143
- "Organization": "Stability AI"
144
  },
145
  {
146
  "Rank": 20,
147
- "\ud83e\udd16 Model": "SD-v1.5",
148
- "\u2b50 Score (\u03bc/\u03c3)": "17.47 (19.9/0.81)",
149
- "\ud83d\uddf3\ufe0f Votes": 228.0,
150
  "Organization": "Stability AI"
151
  },
152
  {
153
  "Rank": 21,
154
- "\ud83e\udd16 Model": "SDXL",
155
- "\u2b50 Score (\u03bc/\u03c3)": "16.83 (19.19/0.79)",
156
- "\ud83d\uddf3\ufe0f Votes": 366.0,
157
  "Organization": "Stability AI"
158
  },
159
  {
160
  "Rank": 22,
161
- "\ud83e\udd16 Model": "SSD-1b",
162
- "\u2b50 Score (\u03bc/\u03c3)": "16.76 (19.23/0.82)",
163
- "\ud83d\uddf3\ufe0f Votes": 216.0,
164
- "Organization": "Segmind"
165
  },
166
  {
167
  "Rank": 23,
168
- "\ud83e\udd16 Model": "Playground-v2.0",
169
- "\u2b50 Score (\u03bc/\u03c3)": "16.37 (18.81/0.81)",
170
- "\ud83d\uddf3\ufe0f Votes": 267.0,
171
- "Organization": "Playground AI"
172
  },
173
  {
174
  "Rank": 24,
175
  "\ud83e\udd16 Model": "Stable-cascade",
176
- "\u2b50 Score (\u03bc/\u03c3)": "15.34 (17.77/0.81)",
177
- "\ud83d\uddf3\ufe0f Votes": 204.0,
178
  "Organization": "Stability AI"
179
  },
180
  {
 
1
  {
2
  "total_models": 27,
3
+ "total_votes": 667,
4
  "sorted_score_list": [
5
  {
6
  "Rank": 0,
7
  "\ud83e\udd16 Model": "Midjourney-v6.0",
8
+ "\u2b50 Score (\u03bc/\u03c3)": "32.64 (35.04/0.8)",
9
+ "\ud83d\uddf3\ufe0f Votes": 352.0,
10
  "Organization": "Midjourney"
11
  },
12
  {
13
  "Rank": 1,
14
  "\ud83e\udd16 Model": "Midjourney-v5.0",
15
+ "\u2b50 Score (\u03bc/\u03c3)": "31.61 (33.99/0.79)",
16
+ "\ud83d\uddf3\ufe0f Votes": 385.0,
17
  "Organization": "Midjourney"
18
  },
19
  {
20
  "Rank": 2,
21
  "\ud83e\udd16 Model": "SD-v3.0",
22
+ "\u2b50 Score (\u03bc/\u03c3)": "29.07 (31.44/0.79)",
23
+ "\ud83d\uddf3\ufe0f Votes": 423.0,
24
  "Organization": "Stability AI"
25
  },
26
  {
27
  "Rank": 3,
28
  "\ud83e\udd16 Model": "Dalle-3",
29
+ "\u2b50 Score (\u03bc/\u03c3)": "28.26 (30.65/0.8)",
30
+ "\ud83d\uddf3\ufe0f Votes": 324.0,
31
  "Organization": "OpenAI"
32
  },
33
  {
34
  "Rank": 4,
35
+ "\ud83e\udd16 Model": "Proteus-v0.2",
36
+ "\u2b50 Score (\u03bc/\u03c3)": "26.23 (28.59/0.79)",
37
+ "\ud83d\uddf3\ufe0f Votes": 357.0,
38
+ "Organization": "DataAutoGPT3"
39
  },
40
  {
41
  "Rank": 5,
42
+ "\ud83e\udd16 Model": "Dreamshaper-xl",
43
+ "\u2b50 Score (\u03bc/\u03c3)": "25.96 (28.31/0.79)",
44
+ "\ud83d\uddf3\ufe0f Votes": 342.0,
45
+ "Organization": "Lykon"
46
+ },
47
+ {
48
+ "Rank": 6,
49
  "\ud83e\udd16 Model": "Open-Dalle-v1.1",
50
  "\u2b50 Score (\u03bc/\u03c3)": "25.84 (28.19/0.78)",
51
  "\ud83d\uddf3\ufe0f Votes": 351.0,
52
  "Organization": "DataAutoGPT3"
53
  },
54
  {
55
+ "Rank": 7,
56
+ "\ud83e\udd16 Model": "Pixart-Sigma",
57
+ "\u2b50 Score (\u03bc/\u03c3)": "25.53 (27.9/0.79)",
58
+ "\ud83d\uddf3\ufe0f Votes": 423.0,
59
+ "Organization": "PixArt-Alpha"
60
  },
61
  {
62
+ "Rank": 8,
63
  "\ud83e\udd16 Model": "Deepfloyd-IF",
64
+ "\u2b50 Score (\u03bc/\u03c3)": "25.29 (27.66/0.79)",
65
+ "\ud83d\uddf3\ufe0f Votes": 306.0,
66
  "Organization": "DeepFloyd"
67
  },
68
  {
69
+ "Rank": 9,
70
  "\ud83e\udd16 Model": "Realvisxl-v2.0",
71
+ "\u2b50 Score (\u03bc/\u03c3)": "25.13 (27.49/0.79)",
72
+ "\ud83d\uddf3\ufe0f Votes": 327.0,
73
  "Organization": "Realistic Vision"
74
  },
 
 
 
 
 
 
 
75
  {
76
  "Rank": 10,
77
+ "\ud83e\udd16 Model": "Realvisxl-v3.0",
78
+ "\u2b50 Score (\u03bc/\u03c3)": "24.26 (26.62/0.79)",
79
+ "\ud83d\uddf3\ufe0f Votes": 309.0,
80
+ "Organization": "Realistic Vision"
81
  },
82
  {
83
  "Rank": 11,
84
+ "\ud83e\udd16 Model": "Kandinsky-v2.2",
85
+ "\u2b50 Score (\u03bc/\u03c3)": "24.2 (26.56/0.79)",
86
+ "\ud83d\uddf3\ufe0f Votes": 321.0,
87
+ "Organization": "AI-Forever"
88
  },
89
  {
90
  "Rank": 12,
91
+ "\ud83e\udd16 Model": "Dalle-2",
92
+ "\u2b50 Score (\u03bc/\u03c3)": "23.27 (25.64/0.79)",
93
+ "\ud83d\uddf3\ufe0f Votes": 249.0,
94
+ "Organization": "OpenAI"
95
  },
96
  {
97
  "Rank": 13,
98
+ "\ud83e\udd16 Model": "Kandinsky-v2.0",
99
+ "\u2b50 Score (\u03bc/\u03c3)": "21.19 (23.57/0.79)",
100
+ "\ud83d\uddf3\ufe0f Votes": 252.0,
101
+ "Organization": "AI-Forever"
102
  },
103
  {
104
  "Rank": 14,
105
+ "\ud83e\udd16 Model": "SDXL-turbo",
106
+ "\u2b50 Score (\u03bc/\u03c3)": "21.05 (23.42/0.79)",
107
+ "\ud83d\uddf3\ufe0f Votes": 273.0,
108
+ "Organization": "Stability AI"
109
  },
110
  {
111
  "Rank": 15,
112
+ "\ud83e\udd16 Model": "LCM-v1.5",
113
+ "\u2b50 Score (\u03bc/\u03c3)": "19.94 (22.32/0.79)",
114
+ "\ud83d\uddf3\ufe0f Votes": 273.0,
115
+ "Organization": "Tsinghua"
116
  },
117
  {
118
  "Rank": 16,
119
  "\ud83e\udd16 Model": "Openjourney-v4",
120
+ "\u2b50 Score (\u03bc/\u03c3)": "19.87 (22.24/0.79)",
121
+ "\ud83d\uddf3\ufe0f Votes": 264.0,
122
  "Organization": "Prompthero"
123
  },
124
  {
125
  "Rank": 17,
126
+ "\ud83e\udd16 Model": "SD-turbo",
127
+ "\u2b50 Score (\u03bc/\u03c3)": "17.98 (20.36/0.79)",
128
+ "\ud83d\uddf3\ufe0f Votes": 252.0,
129
  "Organization": "Stability AI"
130
  },
131
  {
132
  "Rank": 18,
133
  "\ud83e\udd16 Model": "Playground-v2.5",
134
+ "\u2b50 Score (\u03bc/\u03c3)": "17.85 (20.23/0.8)",
135
+ "\ud83d\uddf3\ufe0f Votes": 252.0,
136
  "Organization": "Playground AI"
137
  },
138
  {
139
  "Rank": 19,
140
+ "\ud83e\udd16 Model": "SSD-1b",
141
+ "\u2b50 Score (\u03bc/\u03c3)": "17.48 (19.89/0.8)",
142
+ "\ud83d\uddf3\ufe0f Votes": 252.0,
143
+ "Organization": "Segmind"
144
  },
145
  {
146
  "Rank": 20,
147
+ "\ud83e\udd16 Model": "SD-v2.1",
148
+ "\u2b50 Score (\u03bc/\u03c3)": "17.35 (19.74/0.8)",
149
+ "\ud83d\uddf3\ufe0f Votes": 255.0,
150
  "Organization": "Stability AI"
151
  },
152
  {
153
  "Rank": 21,
154
+ "\ud83e\udd16 Model": "SD-v1.5",
155
+ "\u2b50 Score (\u03bc/\u03c3)": "17.02 (19.39/0.79)",
156
+ "\ud83d\uddf3\ufe0f Votes": 270.0,
157
  "Organization": "Stability AI"
158
  },
159
  {
160
  "Rank": 22,
161
+ "\ud83e\udd16 Model": "Playground-v2.0",
162
+ "\u2b50 Score (\u03bc/\u03c3)": "16.84 (19.21/0.79)",
163
+ "\ud83d\uddf3\ufe0f Votes": 315.0,
164
+ "Organization": "Playground AI"
165
  },
166
  {
167
  "Rank": 23,
168
+ "\ud83e\udd16 Model": "SDXL",
169
+ "\u2b50 Score (\u03bc/\u03c3)": "16.74 (19.09/0.79)",
170
+ "\ud83d\uddf3\ufe0f Votes": 378.0,
171
+ "Organization": "Stability AI"
172
  },
173
  {
174
  "Rank": 24,
175
  "\ud83e\udd16 Model": "Stable-cascade",
176
+ "\u2b50 Score (\u03bc/\u03c3)": "16.32 (18.69/0.79)",
177
+ "\ud83d\uddf3\ufe0f Votes": 249.0,
178
  "Organization": "Stability AI"
179
  },
180
  {
sum_prompt.txt CHANGED
The diff for this file is too large to render. See raw diff