talalif's picture
Update app.py
6dd2bea verified
raw
history blame
569 Bytes
import subprocess
import os
import spaces
subprocess.run(["git","clone","https://github.com/ExponentialML/Text-To-Video-Finetuning.git"])
os.chdir("./Text-To-Video-Finetuning")
subprocess.run(["pip","install","-r","requirements.txt"])
with open ("app_svd.py","r+") as app:
text = app.read()
if not "spaces" in text:
text = text.replace("def animate()","""@spaces.GPU
def animate""")
text = text.replace("import math","""import math
import spaces""")
app.write(text)
app.truncate()
app.seek(0)
subprocess.run("python","app_svd.py")