Skip to content

Commit e334bd6

Browse files
committed
Improved hardware acceleration readme steps
1 parent 91e954a commit e334bd6

File tree

5 files changed

+33
-21
lines changed

5 files changed

+33
-21
lines changed

README.md

+21-12
Original file line numberDiff line numberDiff line change
@@ -20,42 +20,51 @@ The primary stem typically contains the instrumental part of the audio, while th
2020

2121
You'll need `ffmpeg` and `libsndfile`, which should be easy to install on most platforms, e.g.:
2222

23-
- Debian/Ubuntu: `apt-get update; apt-get install -y libsndfile1-dev ffmpeg`
24-
- macOS: `brew update; brew install libsndfile ffmpeg`
23+
### 🐧 Debian/Ubuntu
24+
`apt-get update; apt-get install -y libsndfile1-dev ffmpeg`
25+
26+
###  macOS
27+
`brew update; brew install libsndfile ffmpeg`
2528

2629
You can then install Audio Separator using pip, use one of the following to install the correct onnxruntime dependency for your device:
2730

28-
### Nvidia GPU with CUDA acceleration:
31+
### 🎮 Nvidia GPU with CUDA acceleration
2932

3033
`pip install audio-separator[gpu]`
3134

32-
### Apple Silicon, macOS Sonoma+ with CoreML acceleration:
35+
- 💬 If successfully configured, you should see this log message when running audio-separator:
36+
`ONNXruntime has CUDAExecutionProvider available, enabling acceleration`
37+
38+
###  Apple Silicon, macOS Sonoma+ with CoreML acceleration
3339

3440
`pip install audio-separator[silicon]`
3541

36-
### No hardware acceleration, CPU only:
42+
- 💬 If successfully configured, you should see this log message when running audio-separator:
43+
`ONNXruntime has CoreMLExecutionProvider available, enabling acceleration`
44+
45+
### 🐢 No hardware acceleration, CPU only:
3746

3847
`pip install audio-separator[cpu]`
3948

4049

41-
### GPU / CUDA specific steps
50+
## GPU / CUDA specific installation steps
4251

4352
In theory, all you should need to do to get `audio-separator` working with a GPU is install it with the `[gpu]` extra as above.
4453

45-
However, sometimes getting both PyTorch and ONNX Runtime working with CUDA support can be a bit tricky so sometimes it may not be that easy.
54+
However, sometimes getting both PyTorch and ONNX Runtime working with CUDA support can be a bit tricky so it may not work that easily.
4655

47-
You may need to reinstall them directly, allowing pip to calculate the right versions for your platform:
56+
You may need to reinstall both packages directly, allowing pip to calculate the right versions for your platform:
4857

4958
- `pip uninstall torch onnxruntime`
5059
- `pip cache purge`
51-
- `pip install torch torchvision torchaudio`
52-
- `pip install onnxruntime-gpu`
60+
- `pip install --force-reinstall torch torchvision torchaudio`
61+
- `pip install --force-reinstall onnxruntime-gpu`
5362

5463
Depending on your hardware, you may get better performance with the optimum version of onnxruntime:
55-
- `pip install "optimum[onnxruntime-gpu]"`
64+
- `pip install --force-reinstall "optimum[onnxruntime-gpu]"`
5665

5766
Depending on your CUDA version and hardware, you may need to install torch from the `cu118` index instead:
58-
- `pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118`
67+
- `pip install --force-reinstall torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118`
5968

6069
> Note: if anyone knows how to make this cleaner so we can support both different platform-specific dependencies for hardware acceleration without a separate installation process for each, please let me know or raise a PR!
6170

audio_separator/separator.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def __init__(
117117
self.device = torch.device("cuda")
118118

119119
if ort_device == "GPU" and "CUDAExecutionProvider" in ort_providers:
120-
self.logger.info("ONNXruntime device is GPU with CUDAExecutionProvider available, enabling acceleration")
120+
self.logger.info("ONNXruntime has CUDAExecutionProvider available, enabling acceleration")
121121
self.onnx_execution_provider = ["CUDAExecutionProvider"]
122122
hardware_acceleration_enabled = True
123123
else:

audio_separator/utils/cli.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import argparse
33
import logging
44
import pkg_resources
5-
from audio_separator import Separator
65

76

87
def main():
@@ -83,6 +82,9 @@ def main():
8382

8483
logger.info(f"Separator beginning with input file: {args.audio_file}")
8584

85+
# Deliberately import here to avoid loading heave dependencies when just running --help
86+
from audio_separator import Separator
87+
8688
separator = Separator(
8789
args.audio_file,
8890
log_formatter=log_formatter,

poetry.lock

+7-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "audio-separator"
3-
version = "0.9.1"
3+
version = "0.9.2"
44
description = "Easy to use vocal separation on CLI or as a python package, using the amazing MDX-Net models from UVR trained by @Anjok07"
55
authors = ["Andrew Beveridge <[email protected]>"]
66
license = "MIT"

0 commit comments

Comments
 (0)