Spaces:
Build error
Build error
sashavor
commited on
Commit
·
dc0eec0
1
Parent(s):
27938aa
fixing values
Browse files
app.py
CHANGED
@@ -48,8 +48,8 @@ def random_image():
|
|
48 |
options.append(label)
|
49 |
random.shuffle(options)
|
50 |
options = [classes[int(i)] for i in options]
|
51 |
-
return im, label, gr.Radio.update(choices=options), None
|
52 |
-
|
53 |
def check_score(pred, truth, current_score):
|
54 |
if pred == classes[int(truth)]:
|
55 |
return current_score + 1, f"Your score is {current_score}"
|
@@ -85,4 +85,5 @@ with gr.Blocks() as demo:
|
|
85 |
radio.change(compare_score, [radio, prediction], message)
|
86 |
btn.click(random_image, None, [image, image_label, radio, prediction])
|
87 |
|
|
|
88 |
demo.launch()
|
|
|
48 |
options.append(label)
|
49 |
random.shuffle(options)
|
50 |
options = [classes[int(i)] for i in options]
|
51 |
+
return im, label, gr.Radio.update(value=None, choices=options), None
|
52 |
+
|
53 |
def check_score(pred, truth, current_score):
|
54 |
if pred == classes[int(truth)]:
|
55 |
return current_score + 1, f"Your score is {current_score}"
|
|
|
85 |
radio.change(compare_score, [radio, prediction], message)
|
86 |
btn.click(random_image, None, [image, image_label, radio, prediction])
|
87 |
|
88 |
+
|
89 |
demo.launch()
|