Spaces:
Sleeping
Sleeping
Fix for Spaces
Browse files
app.py
CHANGED
|
@@ -17,7 +17,9 @@ CUSTOM_JS_ON_LOAD = """
|
|
| 17 |
async () => {
|
| 18 |
console.log("page.load");
|
| 19 |
window.itv = setInterval(() => {
|
| 20 |
-
const
|
|
|
|
|
|
|
| 21 |
btn.click();
|
| 22 |
}, 1000);
|
| 23 |
// otherwise JS error
|
|
|
|
| 17 |
async () => {
|
| 18 |
console.log("page.load");
|
| 19 |
window.itv = setInterval(() => {
|
| 20 |
+
const root = document.querySelector('body > gradio-app').shadowRoot || document.querySelector('body > gradio-app');
|
| 21 |
+
// ≠ in local or in Spaces for some reason
|
| 22 |
+
const btn = root.querySelector("#run_button");
|
| 23 |
btn.click();
|
| 24 |
}, 1000);
|
| 25 |
// otherwise JS error
|