Spaces:
Paused
Paused
Download create_env.py from michsethowusu/KaniTTS: direct link, hf CLI and curl.
- Browser
- Download file 1.18 kB
-
https://huggingface.co/spaces/michsethowusu/KaniTTS/resolve/main/create_env.py
- Command line
-
hf download hf://spaces/michsethowusu/KaniTTS/create_env.py
-
curl -L -o create_env.py https://huggingface.co/spaces/michsethowusu/KaniTTS/resolve/main/create_env.py
1.18 kB
| import os | |
| import subprocess | |
| import sys | |
| def setup_dependencies(): | |
| os.environ["OMP_NUM_THREADS"] = "4" | |
| try: | |
| if os.path.exists('/tmp/deps_installed'): | |
| return | |
| print("Installing transformers dev version...") | |
| subprocess.check_call([ | |
| sys.executable, "-m", "pip", "install", "--force-reinstall", "--no-cache-dir", | |
| "transformers==4.56.0" | |
| ]) | |
| # Fix ml_dtypes / onnx compatibility | |
| print("Fixing ml_dtypes and onnx compatibility...") | |
| subprocess.check_call([ | |
| sys.executable, "-m", "pip", "install", "--upgrade", | |
| "ml_dtypes>=0.5.0", "onnx>=1.17.0" | |
| ]) | |
| # Restore nemo_toolkit compatible versions | |
| print("Restoring numpy and fsspec to nemo_toolkit compatible versions...") | |
| subprocess.check_call([ | |
| sys.executable, "-m", "pip", "install", "--force-reinstall", | |
| "numpy==1.26.4", "fsspec==2024.12.0" | |
| ]) | |
| with open('/tmp/deps_installed', 'w') as f: | |
| f.write('done') | |
| except Exception as e: | |
| print(f"Dependencies setup error: {e}") |