File size: 816 Bytes
1f50dc9
 
6dd2bea
1f50dc9
32a09c3
 
9fd7dfb
32a09c3
6dd2bea
 
 
 
 
 
 
 
 
2fcf7e6
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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")