Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1051,7 +1051,7 @@ def change_language():
|
|
| 1051 |
class_order = list(range(len(labels)))
|
| 1052 |
np.random.shuffle(class_order)
|
| 1053 |
correct_text = gr.Text(
|
| 1054 |
-
f"-", label="Correct answer"
|
| 1055 |
)
|
| 1056 |
player_score_text = gr.Text(f"-", label="You selected:")
|
| 1057 |
|
|
@@ -1071,11 +1071,11 @@ def select(idx, choice, correct, player_score, choices):
|
|
| 1071 |
player_score = player_score + int(player_correct)
|
| 1072 |
|
| 1073 |
correct_text = gr.Text(
|
| 1074 |
-
f"{correct_name}
|
| 1075 |
-
label="Correct answer",
|
| 1076 |
)
|
| 1077 |
player_score_text = gr.Text(
|
| 1078 |
-
f"Your choice: {player_choice} {'✅' if player_correct else '❌'} (Score: {player_score}) ",
|
| 1079 |
label="You selected:",
|
| 1080 |
)
|
| 1081 |
|
|
@@ -1192,8 +1192,8 @@ with gr.Blocks(title="Babel-ImageNet Quiz", css=css) as demo:
|
|
| 1192 |
elem_classes="choices-group",
|
| 1193 |
)
|
| 1194 |
# with gr.Row():
|
| 1195 |
-
correct_text = gr.Text("
|
| 1196 |
-
player_score_text = gr.Text(f"
|
| 1197 |
# clip_score_text = gr.Text(f"mSigLIP score: 0")
|
| 1198 |
|
| 1199 |
options.select(
|
|
|
|
| 1051 |
class_order = list(range(len(labels)))
|
| 1052 |
np.random.shuffle(class_order)
|
| 1053 |
correct_text = gr.Text(
|
| 1054 |
+
f"-", label="Correct answer:"
|
| 1055 |
)
|
| 1056 |
player_score_text = gr.Text(f"-", label="You selected:")
|
| 1057 |
|
|
|
|
| 1071 |
player_score = player_score + int(player_correct)
|
| 1072 |
|
| 1073 |
correct_text = gr.Text(
|
| 1074 |
+
f"{correct_name}",
|
| 1075 |
+
label="Correct answer:",
|
| 1076 |
)
|
| 1077 |
player_score_text = gr.Text(
|
| 1078 |
+
f"Your choice: {player_choice} {'✅' if player_correct else '❌'} (Score: {player_score}/{idx+1}) ",
|
| 1079 |
label="You selected:",
|
| 1080 |
)
|
| 1081 |
|
|
|
|
| 1192 |
elem_classes="choices-group",
|
| 1193 |
)
|
| 1194 |
# with gr.Row():
|
| 1195 |
+
correct_text = gr.Text("-")
|
| 1196 |
+
player_score_text = gr.Text(f"-")
|
| 1197 |
# clip_score_text = gr.Text(f"mSigLIP score: 0")
|
| 1198 |
|
| 1199 |
options.select(
|