syeuk2002 mdnestor commited on
Commit
e77c3e3
0 Parent(s):

Duplicate from mdnestor/tortoise

Browse files

Co-authored-by: Michael Nestor <mdnestor@users.noreply.huggingface.co>

Files changed (4) hide show
  1. .gitattributes +34 -0
  2. README.md +14 -0
  3. app.py +39 -0
  4. requirements.txt +2 -0
.gitattributes ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tflite filter=lfs diff=lfs merge=lfs -text
29
+ *.tgz filter=lfs diff=lfs merge=lfs -text
30
+ *.wasm filter=lfs diff=lfs merge=lfs -text
31
+ *.xz filter=lfs diff=lfs merge=lfs -text
32
+ *.zip filter=lfs diff=lfs merge=lfs -text
33
+ *.zst filter=lfs diff=lfs merge=lfs -text
34
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: Tortoise
3
+ emoji: 🎧
4
+ colorFrom: blue
5
+ colorTo: pink
6
+ sdk: gradio
7
+ sdk_version: 3.12.0
8
+ app_file: app.py
9
+ pinned: false
10
+ license: mit
11
+ duplicated_from: mdnestor/tortoise
12
+ ---
13
+
14
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
app.py ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import os
3
+ import sys
4
+
5
+ os.system("git clone https://github.com/neonbjb/tortoise-tts.git")
6
+ sys.path.append("./tortoise-tts/")
7
+ os.system("pip install -r ./tortoise-tts/requirements.txt")
8
+ os.system("python ./tortoise-tts/setup.py install")
9
+
10
+ import torch
11
+ import torchaudio
12
+ import torch.nn as nn
13
+ import torch.nn.functional as F
14
+
15
+ from tortoise.api import TextToSpeech
16
+ from tortoise.utils.audio import load_audio, load_voice, load_voices
17
+
18
+ tts = TextToSpeech()
19
+
20
+ def main(text, voice, preset):
21
+ voice_samples, conditioning_latents = load_voice(voice)
22
+ gen = tts.tts_with_preset(text, voice_samples=voice_samples, conditioning_latents=conditioning_latents, preset=preset)
23
+ torchaudio.save("generated.wav", gen.squeeze(0).cpu(), 24000)
24
+ return "generated.wav"
25
+
26
+ voices = ["mol", "tom", "applejack", "daniel", "myself", "weaver", "train_empire", "train_dotrice", "rainbow", "pat", "geralt", "halle", "train_kennard", "jlaw", "train_grace", "angie", "william", "tim_reynolds", "train_atkins", "train_dreams", "train_mouse", "freeman", "deniro", "lj", "train_lescault", "emma", "pat2", "snakes", "train_daws"]
27
+ presets = ["ultra_fast", "fast", "standard", "high_quality"]
28
+
29
+ gr.Interface(
30
+ main,
31
+ [
32
+ gr.Textbox(label="Text", placeholder="Text-to-speak goes here..."),
33
+ gr.Dropdown(voices, value="deniro", label="Voice"),
34
+ gr.Dropdown(presets, value="ultra_fast", label="Preset"),
35
+ ],
36
+ gr.Audio(),
37
+ description="TorToiSe - a multi-voice TTS system by <a href=\"https://huggingface.co/jbetker\">jbetker</a> | <a href=\"https://github.com/neonbjb/tortoise-tts\">src</a>\nNote: inference is very slow on CPU; for quicker inference times use the <a href=\"https://github.com/neonbjb/tortoise-tts#usage-guide\">Colab notebook</a> linked in the source repository.",
38
+ enable_queue=True
39
+ ).launch()
requirements.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ torch
2
+ torchaudio