DongfuJiang commited on
Commit
12e2ec8
1 Parent(s): fb94ede
arena_elo/elo_rating/upload_battle_data.py CHANGED
@@ -75,7 +75,7 @@ def main(
75
  task_type='t2i_generation',
76
  # data_file: str = "./results/latest/clean_battle_conv.json",
77
  data_file: str = None,
78
- repo_id: str = "DongfuJiang/GenAI-Arena-human-eval",
79
  log_dir: str = os.getenv("LOGDIR", "../GenAI-Arena-hf-logs/vote_log"),
80
  config_name='battle',
81
  split='test',
@@ -92,7 +92,6 @@ def main(
92
  # add index according to the tsamp
93
  if seed is not None:
94
  random.seed(seed)
95
- # data = random.sample(data, 50 * 7)
96
 
97
 
98
  data = sorted(data, key=lambda x: x['tstamp'])
@@ -104,11 +103,15 @@ def main(
104
  valid_data = []
105
  for i, battle in enumerate(data):
106
  if any(key not in battle['inputs'] for key in required_keys_each_task[task_type]):
 
107
  # print(f"Skipping battle {i} due to missing keys")
108
  continue
109
  valid_data.append(battle)
 
110
  data = valid_data
111
 
 
 
112
  for i, battle in enumerate(data):
113
  battle['index'] = i
114
 
 
75
  task_type='t2i_generation',
76
  # data_file: str = "./results/latest/clean_battle_conv.json",
77
  data_file: str = None,
78
+ repo_id: str = "TIGER-Lab/GenAI-Arena-human-eval",
79
  log_dir: str = os.getenv("LOGDIR", "../GenAI-Arena-hf-logs/vote_log"),
80
  config_name='battle',
81
  split='test',
 
92
  # add index according to the tsamp
93
  if seed is not None:
94
  random.seed(seed)
 
95
 
96
 
97
  data = sorted(data, key=lambda x: x['tstamp'])
 
103
  valid_data = []
104
  for i, battle in enumerate(data):
105
  if any(key not in battle['inputs'] for key in required_keys_each_task[task_type]):
106
+ # print(battle['inputs'])
107
  # print(f"Skipping battle {i} due to missing keys")
108
  continue
109
  valid_data.append(battle)
110
+ print(f"Total battles: {len(data)}, valid battles: {len(valid_data)}, removed battles: {len(data) - len(valid_data)}")
111
  data = valid_data
112
 
113
+ # data = random.sample(data, 50 * 7+2)
114
+
115
  for i, battle in enumerate(data):
116
  battle['index'] = i
117