Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
f969b11
1
Parent(s):
89adc00
debug
Browse files
arena_elo/elo_rating/clean_battle_data.py
CHANGED
|
@@ -59,8 +59,7 @@ for i in range(len(IDENTITY_WORDS)):
|
|
| 59 |
IDENTITY_WORDS[i] = IDENTITY_WORDS[i].lower()
|
| 60 |
|
| 61 |
def parse_model_name(model_name):
|
| 62 |
-
|
| 63 |
-
model_type, model_name = rest[-1], "_".join(rest[:-1])
|
| 64 |
return model_source, model_name, model_type
|
| 65 |
|
| 66 |
def remove_html(raw):
|
|
@@ -233,8 +232,8 @@ def clean_battle_data(
|
|
| 233 |
valid = True
|
| 234 |
for _model in models:
|
| 235 |
try:
|
| 236 |
-
|
| 237 |
-
platform, model_name, task = parse_model_name(_model)
|
| 238 |
except ValueError:
|
| 239 |
valid = False
|
| 240 |
break
|
|
@@ -245,8 +244,8 @@ def clean_battle_data(
|
|
| 245 |
ct_invalid += 1
|
| 246 |
continue
|
| 247 |
for i, _model in enumerate(models):
|
| 248 |
-
|
| 249 |
-
platform, model_name, task = parse_model_name(_model)
|
| 250 |
models[i] = model_name
|
| 251 |
|
| 252 |
# if not all(x.startswith("imagenhub_") and x.endswith("_edition") for x in models):
|
|
@@ -259,8 +258,8 @@ def clean_battle_data(
|
|
| 259 |
valid = True
|
| 260 |
for _model in models:
|
| 261 |
try:
|
| 262 |
-
|
| 263 |
-
platform, model_name, task = parse_model_name(_model)
|
| 264 |
except ValueError:
|
| 265 |
valid = False
|
| 266 |
break
|
|
@@ -271,8 +270,8 @@ def clean_battle_data(
|
|
| 271 |
ct_invalid += 1
|
| 272 |
continue
|
| 273 |
for i, _model in enumerate(models):
|
| 274 |
-
|
| 275 |
-
platform, model_name, task = parse_model_name(_model)
|
| 276 |
models[i] = model_name
|
| 277 |
# if not all("playground" in x.lower() or (x.startswith("imagenhub_") and x.endswith("_generation")) for x in models):
|
| 278 |
# print(f"Invalid model names: {models}")
|
|
@@ -288,8 +287,8 @@ def clean_battle_data(
|
|
| 288 |
valid = True
|
| 289 |
for _model in models:
|
| 290 |
try:
|
| 291 |
-
|
| 292 |
-
platform, model_name, task = parse_model_name(_model)
|
| 293 |
except ValueError:
|
| 294 |
valid = False
|
| 295 |
break
|
|
@@ -300,8 +299,8 @@ def clean_battle_data(
|
|
| 300 |
ct_invalid += 1
|
| 301 |
continue
|
| 302 |
for i, _model in enumerate(models):
|
| 303 |
-
|
| 304 |
-
platform, model_name, task = parse_model_name(_model)
|
| 305 |
models[i] = model_name
|
| 306 |
|
| 307 |
else:
|
|
|
|
| 59 |
IDENTITY_WORDS[i] = IDENTITY_WORDS[i].lower()
|
| 60 |
|
| 61 |
def parse_model_name(model_name):
|
| 62 |
+
return NotImplementedError()
|
|
|
|
| 63 |
return model_source, model_name, model_type
|
| 64 |
|
| 65 |
def remove_html(raw):
|
|
|
|
| 232 |
valid = True
|
| 233 |
for _model in models:
|
| 234 |
try:
|
| 235 |
+
platform, model_name, task = _model.split("_")
|
| 236 |
+
#platform, model_name, task = parse_model_name(_model)
|
| 237 |
except ValueError:
|
| 238 |
valid = False
|
| 239 |
break
|
|
|
|
| 244 |
ct_invalid += 1
|
| 245 |
continue
|
| 246 |
for i, _model in enumerate(models):
|
| 247 |
+
platform, model_name, task = _model.split("_")
|
| 248 |
+
#platform, model_name, task = parse_model_name(_model)
|
| 249 |
models[i] = model_name
|
| 250 |
|
| 251 |
# if not all(x.startswith("imagenhub_") and x.endswith("_edition") for x in models):
|
|
|
|
| 258 |
valid = True
|
| 259 |
for _model in models:
|
| 260 |
try:
|
| 261 |
+
platform, model_name, task = _model.split("_")
|
| 262 |
+
#platform, model_name, task = parse_model_name(_model)
|
| 263 |
except ValueError:
|
| 264 |
valid = False
|
| 265 |
break
|
|
|
|
| 270 |
ct_invalid += 1
|
| 271 |
continue
|
| 272 |
for i, _model in enumerate(models):
|
| 273 |
+
platform, model_name, task = _model.split("_")
|
| 274 |
+
#platform, model_name, task = parse_model_name(_model)
|
| 275 |
models[i] = model_name
|
| 276 |
# if not all("playground" in x.lower() or (x.startswith("imagenhub_") and x.endswith("_generation")) for x in models):
|
| 277 |
# print(f"Invalid model names: {models}")
|
|
|
|
| 287 |
valid = True
|
| 288 |
for _model in models:
|
| 289 |
try:
|
| 290 |
+
platform, model_name, task = _model.split("_")
|
| 291 |
+
#platform, model_name, task = parse_model_name(_model)
|
| 292 |
except ValueError:
|
| 293 |
valid = False
|
| 294 |
break
|
|
|
|
| 299 |
ct_invalid += 1
|
| 300 |
continue
|
| 301 |
for i, _model in enumerate(models):
|
| 302 |
+
platform, model_name, task = _model.split("_")
|
| 303 |
+
#platform, model_name, task = parse_model_name(_model)
|
| 304 |
models[i] = model_name
|
| 305 |
|
| 306 |
else:
|
model/models/__init__.py
CHANGED
|
@@ -33,9 +33,8 @@ def load_pipeline(model_name):
|
|
| 33 |
the name is the name of the model used to load the model
|
| 34 |
the type is the type of the model, either generation or edition
|
| 35 |
"""
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
model_type, model_name = rest[-1], "_".join(rest[:-1])
|
| 39 |
print("model_source, model_name, model_type =", model_source, model_name, model_type)
|
| 40 |
if model_source == "imagenhub":
|
| 41 |
pipe = load_imagenhub_model(model_name, model_type)
|
|
|
|
| 33 |
the name is the name of the model used to load the model
|
| 34 |
the type is the type of the model, either generation or edition
|
| 35 |
"""
|
| 36 |
+
model_source, model_name, model_type = model_name.split("_")
|
| 37 |
+
# TODO ^Support model_name that contains _ in the name
|
|
|
|
| 38 |
print("model_source, model_name, model_type =", model_source, model_name, model_type)
|
| 39 |
if model_source == "imagenhub":
|
| 40 |
pipe = load_imagenhub_model(model_name, model_type)
|