Spaces:
Runtime error
Runtime error
launch compute on page launch
Browse files- app.py +13 -1
- packages.txt +0 -1
app.py
CHANGED
|
@@ -15,7 +15,19 @@ HF_TOKEN = os.environ.get("HF_TOKEN")
|
|
| 15 |
|
| 16 |
print("hfh", huggingface_hub.__version__)
|
| 17 |
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
|
| 21 |
repo = Repository(
|
|
|
|
| 15 |
|
| 16 |
print("hfh", huggingface_hub.__version__)
|
| 17 |
|
| 18 |
+
# overriding/appending to the gradio template
|
| 19 |
+
SCRIPT = """
|
| 20 |
+
<script>
|
| 21 |
+
if (!window.hasBeenRun) {
|
| 22 |
+
window.hasBeenRun = true;
|
| 23 |
+
console.log("should only happen once");
|
| 24 |
+
document.querySelector("button.submit").click();
|
| 25 |
+
}
|
| 26 |
+
</script>
|
| 27 |
+
"""
|
| 28 |
+
with open(os.path.join(gr.networking.STATIC_TEMPLATE_LIB, "frontend", "index.html"), "a") as f:
|
| 29 |
+
f.write(SCRIPT)
|
| 30 |
+
|
| 31 |
|
| 32 |
|
| 33 |
repo = Repository(
|
packages.txt
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
git-lfs
|
|
|
|
|
|