kokuma commited on
Commit
0b916bb
·
verified ·
1 Parent(s): 1762b34

Modify choices

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -1096,7 +1096,7 @@ def prepare(raw_idx, text_embeddings, class_order):
1096
  while class_idx in no_image_idxs:
1097
  raw_idx = (raw_idx + 1) % len(babel_imagenet["EN"][0])
1098
  idx = class_order[raw_idx]
1099
- lang_class_idxs = babel_imagenet["EN"][0] if "EN" != "EN" else list(range(1000))
1100
  class_idx = lang_class_idxs[idx]
1101
 
1102
  img_idx = 0
@@ -1124,6 +1124,8 @@ def prepare(raw_idx, text_embeddings, class_order):
1124
  choice_values[correct_choice_idx],
1125
  ]
1126
 
 
 
1127
  choice_values = list(zip(choice_names, choice_values))
1128
 
1129
  next_radio = gr.Radio(
@@ -1174,6 +1176,8 @@ def reroll(raw_idx, text_embeddings, class_order):
1174
  choice_values[correct_choice_idx],
1175
  ]
1176
 
 
 
1177
  choice_values = list(zip(choice_names, choice_values))
1178
 
1179
  next_radio = gr.Radio(
 
1096
  while class_idx in no_image_idxs:
1097
  raw_idx = (raw_idx + 1) % len(babel_imagenet["EN"][0])
1098
  idx = class_order[raw_idx]
1099
+ lang_class_idxs = list(range(1000))
1100
  class_idx = lang_class_idxs[idx]
1101
 
1102
  img_idx = 0
 
1124
  choice_values[correct_choice_idx],
1125
  ]
1126
 
1127
+ for i, name in enumerate(choice_names):
1128
+ choice_names[i] = f"({i+1}) {name}"
1129
  choice_values = list(zip(choice_names, choice_values))
1130
 
1131
  next_radio = gr.Radio(
 
1176
  choice_values[correct_choice_idx],
1177
  ]
1178
 
1179
+ for i, name in enumerate(choice_names):
1180
+ choice_names[i] = f"({i+1}) {name}"
1181
  choice_values = list(zip(choice_names, choice_values))
1182
 
1183
  next_radio = gr.Radio(