Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,11 +5,18 @@ import numpy as np
|
|
| 5 |
import soundfile as sf
|
| 6 |
import torch
|
| 7 |
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
from Preprocessing.AudioPreprocessor import AudioPreprocessor
|
| 10 |
from TrainingInterfaces.Text_to_Spectrogram.AutoAligner.Aligner import Aligner
|
| 11 |
from TrainingInterfaces.Text_to_Spectrogram.FastSpeech2.DurationCalculator import DurationCalculator
|
| 12 |
-
from
|
| 13 |
|
| 14 |
|
| 15 |
def float2pcm(sig, dtype='int16'):
|
|
@@ -32,7 +39,7 @@ class TTS_Interface:
|
|
| 32 |
|
| 33 |
def __init__(self):
|
| 34 |
self.device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 35 |
-
self.utterance_cloner = UtteranceCloner(device=self.device)
|
| 36 |
self.speaker_path_lookup = {
|
| 37 |
"Voice 1": "reference_audios/voice_1.flac",
|
| 38 |
"Voice 2": "reference_audios/voice_2.wav",
|
|
|
|
| 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 |
+
|
| 11 |
+
from run_model_downloader import download_models
|
| 12 |
+
|
| 13 |
+
download_models()
|
| 14 |
+
|
| 15 |
+
from Preprocessing.TextFrontend import ArticulatoryCombinedTextFrontend
|
| 16 |
from Preprocessing.AudioPreprocessor import AudioPreprocessor
|
| 17 |
from TrainingInterfaces.Text_to_Spectrogram.AutoAligner.Aligner import Aligner
|
| 18 |
from TrainingInterfaces.Text_to_Spectrogram.FastSpeech2.DurationCalculator import DurationCalculator
|
| 19 |
+
from InferenceInterfaces.UtteranceCloner import UtteranceCloner
|
| 20 |
|
| 21 |
|
| 22 |
def float2pcm(sig, dtype='int16'):
|
|
|
|
| 39 |
|
| 40 |
def __init__(self):
|
| 41 |
self.device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 42 |
+
self.utterance_cloner = UtteranceCloner(model_id="Meta", device=self.device)
|
| 43 |
self.speaker_path_lookup = {
|
| 44 |
"Voice 1": "reference_audios/voice_1.flac",
|
| 45 |
"Voice 2": "reference_audios/voice_2.wav",
|