Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -54,9 +54,9 @@ def change_language(lang):
|
|
54 |
text_features = text_features.cpu().numpy()
|
55 |
else:
|
56 |
text_features = None
|
57 |
-
correct_text = gr.Text(f"
|
58 |
-
player_score_text = gr.Text(f"
|
59 |
-
clip_score_text = gr.Text(f"
|
60 |
|
61 |
return text_features, -1, class_order, correct_text, player_score_text, clip_score_text, 0, 0
|
62 |
|
@@ -73,8 +73,8 @@ def select(idx, lang, choice, correct, model_choice, player_score, clip_score, c
|
|
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"
|
77 |
-
clip_score_text = gr.Text(f"
|
78 |
|
79 |
return correct_text, player_score_text, clip_score_text, player_score, clip_score
|
80 |
|
@@ -216,14 +216,13 @@ with (gr.Blocks(title="Babel-ImageNet Quiz") as demo):
|
|
216 |
with gr.Column(scale=1):
|
217 |
options = gr.Radio(choices=["", "", "", ""], interactive=False, label="Pulsa ¡Adelante! para empezar.")
|
218 |
# with gr.Row():
|
219 |
-
correct_text = gr.Text("", label="Partida")
|
220 |
-
player_score_text = gr.Text("", label="Personas")
|
221 |
-
clip_score_text = gr.Text("", label="
|
222 |
reroll_btn = gr.Button(value="Muestra otra imagen")
|
223 |
|
224 |
|
225 |
|
226 |
-
|
227 |
options.select(fn=select,
|
228 |
inputs=[class_idx, language_select, options, correct_choice, model_choice, player_score, clip_score, choices],
|
229 |
outputs=[correct_text, player_score_text, clip_score_text, player_score, clip_score]
|
|
|
54 |
text_features = text_features.cpu().numpy()
|
55 |
else:
|
56 |
text_features = None
|
57 |
+
correct_text = gr.Text(f"Respuesta correcta: ''. Question 1/{len(babel_imagenet[lang][0])} ", label="Partida")
|
58 |
+
player_score_text = gr.Text(f" ", label="Personas")
|
59 |
+
clip_score_text = gr.Text(f" ", label="Robots")
|
60 |
|
61 |
return text_features, -1, class_order, correct_text, player_score_text, clip_score_text, 0, 0
|
62 |
|
|
|
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"{player_choice} {'✅' if player_correct else '❌'} (Puntos: {player_score}) ", label="Personas")
|
77 |
+
clip_score_text = gr.Text(f"{model_choice_name} {'✅' if model_correct else '❌'} (Puntos: {clip_score})", label="mSigLIP")
|
78 |
|
79 |
return correct_text, player_score_text, clip_score_text, player_score, clip_score
|
80 |
|
|
|
216 |
with gr.Column(scale=1):
|
217 |
options = gr.Radio(choices=["", "", "", ""], interactive=False, label="Pulsa ¡Adelante! para empezar.")
|
218 |
# with gr.Row():
|
219 |
+
correct_text = gr.Text(" ", label="Partida")
|
220 |
+
player_score_text = gr.Text(f" ", label="Personas")
|
221 |
+
clip_score_text = gr.Text(f" ", label="mSigLIP")
|
222 |
reroll_btn = gr.Button(value="Muestra otra imagen")
|
223 |
|
224 |
|
225 |
|
|
|
226 |
options.select(fn=select,
|
227 |
inputs=[class_idx, language_select, options, correct_choice, model_choice, player_score, clip_score, choices],
|
228 |
outputs=[correct_text, player_score_text, clip_score_text, player_score, clip_score]
|