talalif commited on
Commit
6dd2bea
1 Parent(s): 9fd7dfb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -0
app.py CHANGED
@@ -1,7 +1,18 @@
1
  import subprocess
2
  import os
 
3
 
4
  subprocess.run(["git","clone","https://github.com/ExponentialML/Text-To-Video-Finetuning.git"])
5
  os.chdir("./Text-To-Video-Finetuning")
6
  subprocess.run(["pip","install","-r","requirements.txt"])
 
 
 
 
 
 
 
 
 
 
7
  subprocess.run("python","app_svd.py")
 
1
  import subprocess
2
  import os
3
+ import spaces
4
 
5
  subprocess.run(["git","clone","https://github.com/ExponentialML/Text-To-Video-Finetuning.git"])
6
  os.chdir("./Text-To-Video-Finetuning")
7
  subprocess.run(["pip","install","-r","requirements.txt"])
8
+ with open ("app_svd.py","r+") as app:
9
+ text = app.read()
10
+ if not "spaces" in text:
11
+ text = text.replace("def animate()","""@spaces.GPU
12
+ def animate""")
13
+ text = text.replace("import math","""import math
14
+ import spaces""")
15
+ app.write(text)
16
+ app.truncate()
17
+ app.seek(0)
18
  subprocess.run("python","app_svd.py")