Integrate tested Seed-VC GPU conversion into Stimmatelier
This commit is contained in:
1 parent
73e803e943
commit
1445152fec
22 files changed
+688
-17
No files matched your search
@@ -0,0 +1,18 @@
|
||||
"""Native pinned Seed-VC GPU rebuild. Run as the dedicated Deck user, Python3.12."""
|
||||
import argparse,hashlib,json,os,subprocess,sys,tarfile,tempfile,urllib.request
|
||||
from pathlib import Path
|
||||
parser=argparse.ArgumentParser();parser.add_argument('--root',type=Path,required=True);a=parser.parse_args();root=a.root.resolve();recipe=Path(__file__).resolve().parent
|
||||
if root.exists() and any(root.iterdir()):raise SystemExit('Zustandswurzel muss leer sein; nichts überschrieben.')
|
||||
root.mkdir(parents=True,mode=0o700,exist_ok=True)
|
||||
os.environ.update(HOME=str(root),CUDA_VISIBLE_DEVICES='',HF_HUB_DISABLE_IMPLICIT_TOKEN='1',HF_HUB_DISABLE_TELEMETRY='1')
|
||||
def run(*args):subprocess.run([str(x) for x in args],check=True)
|
||||
versions=json.loads((recipe/'versions.json').read_text());revision=versions['source_revision']
|
||||
archive=root/'source.tar.gz';urllib.request.urlretrieve('https://api.github.com/repos/Plachtaa/seed-vc/tarball/'+revision,archive)
|
||||
with tempfile.TemporaryDirectory(dir=root) as tmp:
|
||||
with tarfile.open(archive) as tar:tar.extractall(tmp,filter='data')
|
||||
next(Path(tmp).iterdir()).rename(root/'source')
|
||||
run(sys.executable,'-m','venv',root/'python');py=root/'python/bin/python'
|
||||
run(py,'-m','pip','install','--no-cache-dir','torch==2.4.0+cu124','torchaudio==2.4.0+cu124','torchvision==0.19.0+cu124','--index-url','https://download.pytorch.org/whl/cu124')
|
||||
run(py,'-m','pip','install','--no-cache-dir','-r',recipe/'requirements.lock','--extra-index-url','https://download.pytorch.org/whl/cu124')
|
||||
run(py,recipe/'download.py',root,recipe/'assets.json')
|
||||
run(py,'-m','pip','check');(root/'ready').write_text(revision)
|
||||
Reference in new issue
Block a user