Spaces:
Build error
Build error
added requirement.txt
Browse files- INSTALL.md +41 -0
- requirements.txt +13 -0
- test_requirements.py +36 -0
INSTALL.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Installation (Windows)
|
| 2 |
+
|
| 3 |
+
Install the Python requirements and pick the correct `torch` wheel for your system.
|
| 4 |
+
|
| 5 |
+
1) Upgrade pip and install pinned packages (non-torch):
|
| 6 |
+
|
| 7 |
+
```bash
|
| 8 |
+
python -m pip install --upgrade pip
|
| 9 |
+
pip install -r requirements.txt
|
| 10 |
+
```
|
| 11 |
+
|
| 12 |
+
1) Install `torch` separately so you can pick the wheel that matches your CUDA/CPU setup.
|
| 13 |
+
|
| 14 |
+
- CPU-only (Windows):
|
| 15 |
+
|
| 16 |
+
```bash
|
| 17 |
+
pip install "torch==2.2.2+cpu" --index-url https://download.pytorch.org/whl/cpu
|
| 18 |
+
```
|
| 19 |
+
|
| 20 |
+
- CUDA (example for CUDA 12.1; pick the matching CUDA version for your system):
|
| 21 |
+
|
| 22 |
+
```bash
|
| 23 |
+
pip install "torch==2.2.2+cu121" --index-url https://download.pytorch.org/whl/cu121
|
| 24 |
+
```
|
| 25 |
+
|
| 26 |
+
If you are unsure which CUDA version you have, run `nvidia-smi` in a command
|
| 27 |
+
prompt (if you have an NVIDIA GPU). If you want, tell me your CUDA version and
|
| 28 |
+
I can add the exact install line.
|
| 29 |
+
|
| 30 |
+
1) Optional: verify the environment with the smoke test:
|
| 31 |
+
|
| 32 |
+
```bash
|
| 33 |
+
python test_requirements.py
|
| 34 |
+
```
|
| 35 |
+
|
| 36 |
+
Notes:
|
| 37 |
+
|
| 38 |
+
- The `requirements.txt` contains pinned versions for non-torch packages and
|
| 39 |
+
leaves `torch` unpinned so you can choose the correct wheel for your system.
|
| 40 |
+
- If you want me to pin exact `torch` builds for a specific CUDA version, tell
|
| 41 |
+
me the CUDA version (e.g., `cu121`, `cu118`, or `cpu`).
|
requirements.txt
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Pinned non-torch packages (change versions if you need newer/stable ones)
|
| 2 |
+
gradio==3.60.1
|
| 3 |
+
transformers==4.35.2
|
| 4 |
+
librosa==0.10.0
|
| 5 |
+
safetensors==0.3.2
|
| 6 |
+
accelerate==0.20.3
|
| 7 |
+
soundfile==0.12.1
|
| 8 |
+
|
| 9 |
+
# NOTE: `torch` should be installed via the official PyTorch wheels that match
|
| 10 |
+
# your CUDA version (or CPU-only). See the README.md for Windows CPU/CUDA
|
| 11 |
+
# install commands and pick the appropriate wheel. To keep this file simple
|
| 12 |
+
# we do not pin `torch` here.
|
| 13 |
+
torch
|
test_requirements.py
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import importlib
|
| 2 |
+
import sys
|
| 3 |
+
|
| 4 |
+
packages = [
|
| 5 |
+
('gradio', 'gradio'),
|
| 6 |
+
('torch', 'torch'),
|
| 7 |
+
('librosa', 'librosa'),
|
| 8 |
+
('transformers', 'transformers'),
|
| 9 |
+
('safetensors', 'safetensors'),
|
| 10 |
+
('accelerate', 'accelerate'),
|
| 11 |
+
('soundfile', 'soundfile'),
|
| 12 |
+
]
|
| 13 |
+
|
| 14 |
+
success = True
|
| 15 |
+
for name, mod in packages:
|
| 16 |
+
try:
|
| 17 |
+
m = importlib.import_module(mod)
|
| 18 |
+
v = getattr(m, '__version__', 'unknown')
|
| 19 |
+
print(f'{name}: OK (version={v})')
|
| 20 |
+
except Exception as e:
|
| 21 |
+
success = False
|
| 22 |
+
print(f'{name}: FAIL -> {e}')
|
| 23 |
+
|
| 24 |
+
# Extra torch checks
|
| 25 |
+
try:
|
| 26 |
+
import torch
|
| 27 |
+
print('torch.cuda.is_available():', torch.cuda.is_available())
|
| 28 |
+
print('torch.__version__:', getattr(torch, '__version__', 'unknown'))
|
| 29 |
+
except Exception:
|
| 30 |
+
pass
|
| 31 |
+
|
| 32 |
+
if not success:
|
| 33 |
+
print('\nSome imports failed. Re-run the install commands in INSTALL.md or ask for help.')
|
| 34 |
+
sys.exit(1)
|
| 35 |
+
|
| 36 |
+
print('\nAll imports succeeded (where present).')
|