Spaces:
Runtime error

Hammerhands commited on
Commit
15bacf1
·
verified ·
1 Parent(s): 6b6ed84

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +33 -0
app.py ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import subprocess
3
+ import sys
4
+
5
+ REPO = "https://github.com/TridentIntelFree/Lipsync-.git"
6
+ BRANCHES = ["claude/lipsync-speech-inference-k649jo", "main"]
7
+ CHECKOUT = "/home/user/app/_lipsync"
8
+
9
+ if not os.path.isdir(CHECKOUT):
10
+ for branch in BRANCHES:
11
+ done = subprocess.run(
12
+ ["git", "clone", "--depth", "1", "--branch", branch, REPO, CHECKOUT],
13
+ capture_output=True,
14
+ text=True,
15
+ )
16
+ if done.returncode == 0:
17
+ print(f"Cloned {REPO} @ {branch}")
18
+ break
19
+ else:
20
+ raise SystemExit(f"Could not clone {REPO} from any of {BRANCHES}")
21
+
22
+ sys.path.insert(0, CHECKOUT)
23
+
24
+ os.environ.setdefault(
25
+ "LIPSYNC_CACHE", "/data/lipsync" if os.path.isdir("/data") else "/tmp/lipsync-cache"
26
+ )
27
+
28
+ import app as lipsync_app
29
+
30
+ demo = lipsync_app.build()
31
+
32
+ if __name__ == "__main__":
33
+ demo.launch()