From 5e060ebe3583e50c66af76ae2c16fd070f46af5a Mon Sep 17 00:00:00 2001 From: Patterns Date: Thu, 25 Apr 2024 14:51:55 +0200 Subject: [PATCH] [DOCUMENTATION] Refactored the readme file and added common cuDNN library issues --- docs/QA.md | 33 +++++++++++++++++++++ docs/USAGE.md | 80 +++++++++++++++++++++++++++++++++++++-------------- 2 files changed, 92 insertions(+), 21 deletions(-) diff --git a/docs/QA.md b/docs/QA.md index 4736d1cc..463c9add 100644 --- a/docs/QA.md +++ b/docs/QA.md @@ -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 +``` + +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= + ``` + +- #### Otherwise: + ```bash + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH: + ``` diff --git a/docs/USAGE.md b/docs/USAGE.md index 497a92dd..39e37f01 100644 --- a/docs/USAGE.md +++ b/docs/USAGE.md @@ -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 @@ -32,23 +32,67 @@ For users who want to quickly try OpenVoice and do not require high quality or s -## 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 + source /bin/activate + ``` + +### 2. Clone the OpenVoice repository and enter the newly created directory: +```bash git clone git@github.com: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. @@ -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 @@ -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.