Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,10 +1,5 @@
|
|
1 |
import os
|
2 |
|
3 |
-
import gradio as gr
|
4 |
-
import numpy as np
|
5 |
-
import soundfile as sf
|
6 |
-
import torch
|
7 |
-
|
8 |
os.system("git clone --branch v2.3 https://github.com/DigitalPhonetics/IMS-Toucan.git toucan_codebase")
|
9 |
os.system("mv toucan_codebase/* .")
|
10 |
|
@@ -12,18 +7,15 @@ from run_model_downloader import download_models
|
|
12 |
|
13 |
download_models()
|
14 |
|
15 |
-
|
16 |
-
|
17 |
import gradio as gr
|
18 |
import numpy as np
|
19 |
import torch
|
20 |
-
import math
|
21 |
-
import os
|
22 |
from Preprocessing.TextFrontend import ArticulatoryCombinedTextFrontend
|
23 |
from TrainingInterfaces.Text_to_Spectrogram.AutoAligner.Aligner import Aligner
|
24 |
from TrainingInterfaces.Text_to_Spectrogram.FastSpeech2.DurationCalculator import DurationCalculator
|
25 |
from InferenceInterfaces.UtteranceCloner import UtteranceCloner
|
26 |
|
|
|
27 |
def float2pcm(sig, dtype='int16'):
|
28 |
"""
|
29 |
https://gist.github.com/HudsonHuang/fbdf8e9af7993fe2a91620d3fb86a182
|
@@ -174,7 +166,7 @@ class TTS_Interface:
|
|
174 |
durations=duration,
|
175 |
pitch=pitch,
|
176 |
energy=self.energy,
|
177 |
-
|
178 |
|
179 |
if self.current_voice == "female":
|
180 |
cloned_speech = self.cloned_speech_female
|
@@ -207,7 +199,7 @@ iface = gr.Interface(fn=poem_model.read,
|
|
207 |
gr.outputs.Audio(type="numpy", label="Poem cloned from a reference"),
|
208 |
gr.outputs.Audio(type="numpy", label="Poem after human-in-the-loop adjustments")],
|
209 |
layout="vertical",
|
210 |
-
title="PoeticTTS - Customizing Poetry
|
211 |
thumbnail="Utility/toucan.png",
|
212 |
theme="default",
|
213 |
allow_flagging="never",
|
|
|
1 |
import os
|
2 |
|
|
|
|
|
|
|
|
|
|
|
3 |
os.system("git clone --branch v2.3 https://github.com/DigitalPhonetics/IMS-Toucan.git toucan_codebase")
|
4 |
os.system("mv toucan_codebase/* .")
|
5 |
|
|
|
7 |
|
8 |
download_models()
|
9 |
|
|
|
|
|
10 |
import gradio as gr
|
11 |
import numpy as np
|
12 |
import torch
|
|
|
|
|
13 |
from Preprocessing.TextFrontend import ArticulatoryCombinedTextFrontend
|
14 |
from TrainingInterfaces.Text_to_Spectrogram.AutoAligner.Aligner import Aligner
|
15 |
from TrainingInterfaces.Text_to_Spectrogram.FastSpeech2.DurationCalculator import DurationCalculator
|
16 |
from InferenceInterfaces.UtteranceCloner import UtteranceCloner
|
17 |
|
18 |
+
|
19 |
def float2pcm(sig, dtype='int16'):
|
20 |
"""
|
21 |
https://gist.github.com/HudsonHuang/fbdf8e9af7993fe2a91620d3fb86a182
|
|
|
166 |
durations=duration,
|
167 |
pitch=pitch,
|
168 |
energy=self.energy,
|
169 |
+
input_is_phones=True).cpu()
|
170 |
|
171 |
if self.current_voice == "female":
|
172 |
cloned_speech = self.cloned_speech_female
|
|
|
199 |
gr.outputs.Audio(type="numpy", label="Poem cloned from a reference"),
|
200 |
gr.outputs.Audio(type="numpy", label="Poem after human-in-the-loop adjustments")],
|
201 |
layout="vertical",
|
202 |
+
title="PoeticTTS - Customizing Poetry",
|
203 |
thumbnail="Utility/toucan.png",
|
204 |
theme="default",
|
205 |
allow_flagging="never",
|