kokuma commited on
Commit
3e40c02
·
verified ·
1 Parent(s): 76d9e4b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -72,9 +72,9 @@ def select(idx, lang, choice, correct, model_choice, player_score, clip_score, c
72
  player_score = player_score + int(player_correct)
73
  clip_score = clip_score + int(model_correct)
74
 
75
- correct_text = gr.Text(f"Correct was: '{correct_name}'. Question {idx+1}/{len(babel_imagenet[lang][0])} ", label="Game")
76
- player_score_text = gr.Text(f"Your choice: {player_choice} {'✅' if player_correct else '❌'} (Score: {player_score}) ", label="Player")
77
- clip_score_text = gr.Text(f"mSigLIP chose: '{model_choice_name}' {'✅' if model_correct else '❌'} (Score: {clip_score})", label="Opponent")
78
 
79
  return correct_text, player_score_text, clip_score_text, player_score, clip_score
80
 
@@ -128,8 +128,8 @@ def prepare(raw_idx, lang, text_embeddings, class_order):
128
 
129
  choice_values = list(zip(choice_names, choice_values))
130
 
131
- next_radio = gr.Radio(choices=choice_values, interactive=True, label="Select the correct answer:", value=None)
132
- next_image = gr.Image(value=img_url, width=IMG_WIDTH, height=IMG_WIDTH, label="What class does this image belong to?")
133
 
134
  return next_radio, next_image, raw_idx, correct_choice, model_choice, choice_values
135
 
@@ -176,8 +176,8 @@ def reroll(raw_idx, lang, text_embeddings, class_order):
176
 
177
  choice_values = list(zip(choice_names, choice_values))
178
 
179
- next_radio = gr.Radio(choices=choice_values, interactive=True, label="Select the correct answer:", value=None)
180
- next_image = gr.Image(value=img_url, width=IMG_WIDTH, height=IMG_WIDTH, label="What class does this image belong to?")
181
 
182
  return next_radio, next_image, raw_idx, correct_choice, model_choice, choice_values
183
 
@@ -219,7 +219,7 @@ with (gr.Blocks(title="Babel-ImageNet Quiz") as demo):
219
  correct_text = gr.Text("Pulsa ¡Adelante! para empezar.")
220
  player_score_text = gr.Text(f"Player score: 0")
221
  clip_score_text = gr.Text(f"mSigLIP score: 0")
222
- reroll_btn = gr.Button(value="Reroll the image (for bad images or errors)")
223
 
224
 
225
 
 
72
  player_score = player_score + int(player_correct)
73
  clip_score = clip_score + int(model_correct)
74
 
75
+ correct_text = gr.Text(f"Respuesta correcta: '{correct_name}'. Pregunta {idx+1}/{len(babel_imagenet[lang][0])} ", label="Partida")
76
+ player_score_text = gr.Text(f"Hemos elegido: {player_choice} {'✅' if player_correct else '❌'} (Puntos: {player_score}) ", label="Jugadora")
77
+ clip_score_text = gr.Text(f"mSigLIP ha elegido: '{model_choice_name}' {'✅' if model_correct else '❌'} (Puntos: {clip_score})", label="CLIP")
78
 
79
  return correct_text, player_score_text, clip_score_text, player_score, clip_score
80
 
 
128
 
129
  choice_values = list(zip(choice_names, choice_values))
130
 
131
+ next_radio = gr.Radio(choices=choice_values, interactive=True, label="Elige la respuesta correcta:", value=None)
132
+ next_image = gr.Image(value=img_url, width=IMG_WIDTH, height=IMG_WIDTH, label="¿Qué es esto?")
133
 
134
  return next_radio, next_image, raw_idx, correct_choice, model_choice, choice_values
135
 
 
176
 
177
  choice_values = list(zip(choice_names, choice_values))
178
 
179
+ next_radio = gr.Radio(choices=choice_values, interactive=True, label="Elige la respuesta correcta:", value=None)
180
+ next_image = gr.Image(value=img_url, width=IMG_WIDTH, height=IMG_WIDTH, label="¿Qué es esto?")
181
 
182
  return next_radio, next_image, raw_idx, correct_choice, model_choice, choice_values
183
 
 
219
  correct_text = gr.Text("Pulsa ¡Adelante! para empezar.")
220
  player_score_text = gr.Text(f"Player score: 0")
221
  clip_score_text = gr.Text(f"mSigLIP score: 0")
222
+ reroll_btn = gr.Button(value="Muestra otra imagen")
223
 
224
 
225