talalif's picture
Update app.py
2fcf7e6 verified
raw
history blame contribute delete
No virus
816 Bytes
import subprocess
import os
import spaces
subprocess.run(["git","clone","https://github.com/alibaba/animate-anything.git"])
os.chdir("./animate-anything")
subprocess.run(["pip","install","-r","requirements.txt"])
with open ("/home/user/app/animate-anything/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","--config", "example/train_svd_v2v.yaml","pretrained_model_path=/home/user/app/animate_anything_svd_v1.01.tar"])
import app_svd
app_svd("example/train_svd_v2v.yaml","pretrained_model_path=/home/user/app/animate_anything_svd_v1.01.tar")