Skip to content

Commit

Permalink
support macos
Browse files Browse the repository at this point in the history
  • Loading branch information
BeautyyuYanli committed Jun 6, 2024
1 parent 3e0aae0 commit 3113dd6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,28 @@ Check out the [example](example.ipynb) notebook for a quick start. Or open it in

## Prepare the environment

As we all know, the dependencies of an AI project are always a mess. Here is how I prepare the environment for this project, by conda:
As we all know, the dependencies of an AI project are always a mess. Here is how I prepare the environment for this project:

<details><summary>Conda (Linux)</summary>

```
conda install python=3.10
conda install pytorch=2.1 torchvision torchaudio pytorch-lightning pytorch-cuda=12.1 -c pytorch -c nvidia
conda install ffmpeg=6.1.1 -c conda-forge
```

</details>

<details><summary>MacOS</summary>

```
brew install ffmpeg
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
pip3 install pytorch-lightning
pip3 install GPT-SoVITS-Infer
```
</details>

You can also try to prepare the environment with cpu only options, which should work, but I have not tested it yet.

After the environment is ready, you can install the package by pip:
Expand Down
2 changes: 2 additions & 0 deletions src/gpt_sovits/infer/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ def __init__(
if device is None:
if torch.cuda.is_available():
device = "cuda"
elif torch.backends.mps.is_available():
device = "mps"
else:
device = "cpu"
self.device = device
Expand Down

0 comments on commit 3113dd6

Please sign in to comment.