"""Install the pinned runtime into an isolated virtual environment.""" import argparse import json from pathlib import Path import subprocess import sys def main(): parser=argparse.ArgumentParser(description=__doc__) parser.add_argument('--venv',default='.venv') args=parser.parse_args() root=Path(__file__).resolve().parent venv=Path(args.venv).resolve() manifest=json.loads((root/'orbitquant_manifest.json').read_text()) if not (venv/'bin/python').exists(): subprocess.run(['uv','venv','--python','3.12',str(venv)],check=True) python=str(venv/'bin/python') subprocess.run(['uv','pip','install','--python',python,'torch==2.8.0','torchaudio==2.8.0', '--index-url','https://download.pytorch.org/whl/cu128'],check=True) subprocess.run(['uv','pip','install','--python',python,'--override',str(root/'dependency-overrides.txt'), '-r',str(root/'requirements.txt')],check=True) subprocess.run(['uv','pip','install','--python',python,'--no-deps', str(root/'orbitquant-0.12.0-py3-none-any.whl')],check=True) fish=venv.parent/'.runtime'/'fish-speech' if not fish.exists(): fish.parent.mkdir(parents=True,exist_ok=True) subprocess.run(['git','clone','https://github.com/fishaudio/fish-speech.git',str(fish)],check=True) subprocess.run(['git','-C',str(fish),'checkout',manifest['fish_revision']],check=True) subprocess.run(['uv','pip','install','--python',python,'--no-deps','-e',str(fish)],check=True) print(f'Runtime installed. Use {python} run_tts.py --model {root} --text "Hello." --output speech.wav') if __name__=='__main__': main()