Spaces:
Runtime error
Runtime error
Create app.py
Browse files
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()
|