Skip to content

Commit

Permalink
[DOCUMENTATION] Refactored the readme file and added common cuDNN lib…
Browse files Browse the repository at this point in the history
…rary issues
  • Loading branch information
patterns-complexity committed Apr 25, 2024
1 parent ce65d67 commit 5e060eb
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 21 deletions.
33 changes: 33 additions & 0 deletions docs/QA.md
Expand Up @@ -37,3 +37,36 @@ When calling `get_vad_segments` from `se_extractor.py`, there should be a messag
Downloading: "https://github.com/snakers4/silero-vad/zipball/master" to /home/user/.cache/torch/hub/master.zip
```
The download would fail if your machine can not access github. Please download the zip from "https://github.com/snakers4/silero-vad/zipball/master" manually and unzip it to `/home/user/.cache/torch/hub/snakers4_silero-vad_master`. You can also see [this issue](https://github.com/myshell-ai/OpenVoice/issues/57) for solutions for other versions of silero.

## Missing `cuDNN` libraries
#### Missing `cuDNN` libraries can be downloaded from the url below (requires login but you can just create a new account):

[https://developer.nvidia.com/rdp/cudnn-archive](https://developer.nvidia.com/rdp/cudnn-archive)

At the time of writing the required version of `cuDNN` for OpenVoice is `8.x` for `CUDA 11.x`.

#### Extracting the `cuDNN` libraries:
```bash
tar -xvf <path_to_downloaded_cuDNN_archive>
```

Your `cuDNN` libraries will be in the `bin` directory of the extracted archive.

## My system can't find downloaded `cuDNN` libraries

If you already know the path to the required `cuDNN` libraries, you can set the `LD_LIBRARY_PATH` environment variable to that path. You can do this by running the following commands:

Check if the `LD_LIBRARY_PATH` environment variable is set.
```bash
echo $LD_LIBRARY_PATH
```

- #### If it's empty:
```bash
export LD_LIBRARY_PATH=<path_to_cuDNN_libraries>
```

- #### Otherwise:
```bash
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:<path_to_cuDNN_libraries>
```
80 changes: 59 additions & 21 deletions docs/USAGE.md
Expand Up @@ -3,9 +3,9 @@
## Table of Content

- [Quick Use](#quick-use): directly use OpenVoice without installation.
- [Linux Install](#linux-install): for researchers and developers only.
- [V1](#openvoice-v1)
- [V2](#openvoice-v2)
- [Minimal Demo](#minimal-demo): for users who want to quickly try OpenVoice.
- [Linux Install](#linux-install-for-both-v1-and-v2): installation guide for developers and researchers on Linux.
- [Example Usage](#example-usage): example usage of OpenVoice V1 and V2.
- [Install on Other Platforms](#install-on-other-platforms): unofficial installation guide contributed by the community

## Quick Use
Expand All @@ -32,23 +32,67 @@ For users who want to quickly try OpenVoice and do not require high quality or s
<a href="https://huggingface.co/spaces/myshell-ai/OpenVoice"><img src="../resources/huggingface.png" height="32"></a>
</div>

## Linux Install
## Linux Install (for both V1 and V2)

This section is only for developers and researchers who are familiar with Linux, Python and PyTorch. Clone this repo, and run
This section is only for developers and researchers who are familiar with Linux, Python and PyTorch.

```
conda create -n openvoice python=3.9
conda activate openvoice
### 1. Create a virtual environment:

- #### If you're using Conda
```bash
conda create -n openvoice python=3.9
conda activate openvoice
```

- #### If you're using Virtualenv
```bash
python3 -m venv <your_venv_name>
source <your_venv_name>/bin/activate
```

### 2. Clone the OpenVoice repository and enter the newly created directory:
```bash
git clone [email protected]:myshell-ai/OpenVoice.git
cd OpenVoice
```

### 3. Install in editable mode:
```bash
pip install -e .
```

No matter if you are using V1 or V2, the above installation is the same.
### 4. Install project dependencies:
```bash
pip install -r requirements.txt
```

### OpenVoice V1
### 5. Download the appropriate model checkpoint:

- #### OpenVoice V1:
Download the checkpoint from [here](https://myshell-public-repo-hosting.s3.amazonaws.com/openvoice/checkpoints_1226.zip) and extract it to the `checkpoints` folder.

- #### OpenVoice V2:
Download the checkpoint from [here](https://myshell-public-repo-hosting.s3.amazonaws.com/openvoice/checkpoints_v2_0417.zip) and extract it to the `checkpoints_v2` folder.

### 6. (OpenVoice V2 only) Install [MeloTTS](https://github.com/myshell-ai/MeloTTS):
```
pip install git+https://github.com/myshell-ai/MeloTTS.git
python -m unidic download
```

Download the checkpoint from [here](https://myshell-public-repo-hosting.s3.amazonaws.com/openvoice/checkpoints_1226.zip) and extract it to the `checkpoints` folder.
### 7. (GPU) Running OpenVoice on GPU:

If you're seeing an error about missing `libcudnn_ops_infer.so.8` (or similar) when you run OpenVoice, that means you do not have all the necessary `cuDNN` libraries installed, or they have been placed in a directory that is not in your `LD_LIBRARY_PATH` environment variable.

To fix this problem see:

[Common Issues - Missing `cuDNN` libraries](QA.md#missing-cudnn-libraries)

[Common Issues - My system can't find downloaded `cuDNN` libraries](QA.md#my-system-cant-find-downloaded-cudnn-libraries)

## Example Usage

### OpenVoice V1

**1. Flexible Voice Style Control.**
Please see [`demo_part1.ipynb`](../demo_part1.ipynb) for an example usage of how OpenVoice enables flexible style control over the cloned voice.
Expand All @@ -60,16 +104,7 @@ Please see [`demo_part2.ipynb`](../demo_part2.ipynb) for an example for language

### OpenVoice V2

Download the checkpoint from [here](https://myshell-public-repo-hosting.s3.amazonaws.com/openvoice/checkpoints_v2_0417.zip) and extract it to the `checkpoints_v2` folder.

Install [MeloTTS](https://github.com/myshell-ai/MeloTTS):
```
pip install git+https://github.com/myshell-ai/MeloTTS.git
python -m unidic download
```

**Demo Usage.** Please see [`demo_part3.ipynb`](../demo_part3.ipynb) for example usage of OpenVoice V2. Now it natively supports English, Spanish, French, Chinese, Japanese and Korean.

**1. Demo usage of V2.** Please see [`demo_part3.ipynb`](../demo_part3.ipynb) for example usage of OpenVoice V2. Now it natively supports English, Spanish, French, Chinese, Japanese and Korean.

## Install on Other Platforms

Expand All @@ -81,3 +116,6 @@ This section provides the unofficial installation guides by open-source contribu
- Docker
- [Guide](https://github.com/StevenJSCF/OpenVoice/blob/update-docs/docs/DF_USAGE.md) by [@StevenJSCF](https://github.com/StevenJSCF)
- You are welcome to contribute if you have a better installation guide. We will list you here.

## Common Issues
See [common issues](QA.md) for common issues and solutions.

0 comments on commit 5e060eb

Please sign in to comment.