julien-c HF staff commited on
Commit
91076cd
1 Parent(s): 2bce5f5

launch compute on page launch

Browse files
Files changed (2) hide show
  1. app.py +13 -1
  2. 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
- os.system("git lfs install --local")
 
 
 
 
 
 
 
 
 
 
 
 
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