Giter VIP home page Giter VIP logo

tortoise_local's Introduction

Tortoise-TTS Local Installation Guide

Step 1: Setup Miniconda

Follow the installation guide for your specific system:

Windows Mac Linux

Verify that your installation was successful by typing:
conda list

Step 2: Create Conda environment

conda create -n tortoise python=3.8
conda activate tortoise

Step 3: Install PyTorch

Install PyTorch on your local computer using the following instructions (use Conda as package):

https://pytorch.org/get-started/locally/

Check if PyTorch is using your GPU:
python

>>> import torch

>>> torch.cuda.is_available()
True

Step 4: Setup the Tortoise-TTS model

git clone https://github.com/neonbjb/tortoise-tts

cd tortoise-tts

pip install numpy==1.23.0

python setup.py install

Step 5: Generate speech

# tts.py
import torch
import torchaudio
import torch.nn as nn
import torch.nn.functional as F
from tortoise.api import TextToSpeech
from tortoise.utils.audio import load_audio, load_voice, load_voices

# This will download all the models used by Tortoise from the HuggingFace hub.
tts = TextToSpeech()

# This is the text that will be spoken.
text = "Thanks for reading this article. I hope you learned something."

# Pick a "preset mode" to determine quality. Options: {"ultra_fast", "fast" (default), "standard", "high_quality"}. See docs in api.py
preset = "fast"

CUSTOM_VOICE_NAME = "tom"

voice_samples, conditioning_latents = load_voice(CUSTOM_VOICE_NAME)

gen = tts.tts_with_preset(text, voice_samples=voice_samples, conditioning_latents=conditioning_latents, preset=preset)

torchaudio.save(f'generated-{CUSTOM_VOICE_NAME}.wav', gen.squeeze(0).cpu(), 24000)

Step 6: Get creative & have fun!

tortoise_local's People

Contributors

thisserand avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.