Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -513,24 +513,24 @@ async def predict(image):
|
|
513 |
{dogs_info}
|
514 |
|
515 |
<script>
|
516 |
-
document.querySelectorAll('button[id^="Dog"]').forEach(button => {
|
517 |
console.log('Attaching event to button: ' + button.id);
|
518 |
-
button.addEventListener('click', () => {
|
519 |
const button_id = button.id;
|
520 |
console.log('Button clicked: ' + button_id);
|
521 |
const radio = document.querySelector('input[type=radio][value="' + button_id + '"]');
|
522 |
-
if (radio) {
|
523 |
radio.click();
|
524 |
console.log('Radio button clicked for: ' + button_id);
|
525 |
-
} else {
|
526 |
-
console.error("Radio button not found for:
|
527 |
-
}
|
528 |
-
});
|
529 |
-
});
|
530 |
</script>
|
531 |
-
|
532 |
"""
|
533 |
|
|
|
534 |
initial_state = {
|
535 |
"dogs_info": dogs_info,
|
536 |
"buttons": buttons,
|
|
|
513 |
{dogs_info}
|
514 |
|
515 |
<script>
|
516 |
+
document.querySelectorAll('button[id^="Dog"]').forEach(button => {{
|
517 |
console.log('Attaching event to button: ' + button.id);
|
518 |
+
button.addEventListener('click', () => {{
|
519 |
const button_id = button.id;
|
520 |
console.log('Button clicked: ' + button_id);
|
521 |
const radio = document.querySelector('input[type=radio][value="' + button_id + '"]');
|
522 |
+
if (radio) {{
|
523 |
radio.click();
|
524 |
console.log('Radio button clicked for: ' + button_id);
|
525 |
+
}} else {{
|
526 |
+
console.error("Radio button not found for: ' + button_id);
|
527 |
+
}}
|
528 |
+
}});
|
529 |
+
}});
|
530 |
</script>
|
|
|
531 |
"""
|
532 |
|
533 |
+
|
534 |
initial_state = {
|
535 |
"dogs_info": dogs_info,
|
536 |
"buttons": buttons,
|