Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -4,7 +4,7 @@ import torch
|
|
4 |
from datasets import load_dataset
|
5 |
|
6 |
from transformers import SpeechT5ForTextToSpeech, SpeechT5HifiGan, SpeechT5Processor, pipeline
|
7 |
-
|
8 |
|
9 |
device = "cuda:0" if torch.cuda.is_available() else "cpu"
|
10 |
|
@@ -12,12 +12,19 @@ device = "cuda:0" if torch.cuda.is_available() else "cpu"
|
|
12 |
asr_pipe = pipeline("automatic-speech-recognition", model="openai/whisper-base", device=device)
|
13 |
|
14 |
# load text-to-speech checkpoint and speaker embeddings
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
#processor = SpeechT5Processor.from_pretrained("microsoft/speecht5_tts")
|
16 |
-
|
17 |
-
processor = SpeechT5Processor.from_pretrained("sanchit-gandhi/speecht5_tts_vox_nl")
|
18 |
|
19 |
-
model = SpeechT5ForTextToSpeech.from_pretrained("sanchit-gandhi/speecht5_tts_vox_nl").to(device)
|
20 |
-
|
21 |
#model = SpeechT5ForTextToSpeech.from_pretrained("microsoft/speecht5_tts").to(device)
|
22 |
vocoder = SpeechT5HifiGan.from_pretrained("microsoft/speecht5_hifigan").to(device)
|
23 |
|
|
|
4 |
from datasets import load_dataset
|
5 |
|
6 |
from transformers import SpeechT5ForTextToSpeech, SpeechT5HifiGan, SpeechT5Processor, pipeline
|
7 |
+
from transformers import VitsModel, VitsTokenizer
|
8 |
|
9 |
device = "cuda:0" if torch.cuda.is_available() else "cpu"
|
10 |
|
|
|
12 |
asr_pipe = pipeline("automatic-speech-recognition", model="openai/whisper-base", device=device)
|
13 |
|
14 |
# load text-to-speech checkpoint and speaker embeddings
|
15 |
+
|
16 |
+
|
17 |
+
|
18 |
+
#model = VitsModel.from_pretrained("Matthijs/mms-tts-deu")
|
19 |
+
#tokenizer = VitsTokenizer.from_pretrained("Matthijs/mms-tts-deu")
|
20 |
+
|
21 |
+
|
22 |
#processor = SpeechT5Processor.from_pretrained("microsoft/speecht5_tts")
|
23 |
+
processor = SpeechT5Processor.from_pretrained("kfahn/speecht5_finetuned_voxpopuli_cs")
|
24 |
+
#processor = SpeechT5Processor.from_pretrained("sanchit-gandhi/speecht5_tts_vox_nl")
|
25 |
|
26 |
+
#model = SpeechT5ForTextToSpeech.from_pretrained("sanchit-gandhi/speecht5_tts_vox_nl").to(device)
|
27 |
+
model = SpeechT5ForTextToSpeech.from_pretrained("kfahn/speecht5_finetuned_voxpopuli_cs").to(device)
|
28 |
#model = SpeechT5ForTextToSpeech.from_pretrained("microsoft/speecht5_tts").to(device)
|
29 |
vocoder = SpeechT5HifiGan.from_pretrained("microsoft/speecht5_hifigan").to(device)
|
30 |
|