Commit
·
faf5fc4
1
Parent(s):
1d4b46f
Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,3 @@
|
|
1 |
-
!pip install phonemizer
|
2 |
|
3 |
import gradio as gr
|
4 |
import numpy as np
|
@@ -11,14 +10,14 @@ from transformers import VitsModel, VitsTokenizer, FSMTForConditionalGeneration,
|
|
11 |
device = "cuda:0" if torch.cuda.is_available() else "cpu"
|
12 |
|
13 |
# Transform audio to en text
|
14 |
-
asr_pipe = pipeline("automatic-speech-recognition", model="asapp/sew-d-tiny-
|
15 |
|
16 |
# Translate en to rus text
|
17 |
translation_en_to_rus = pipeline("translation", model="Helsinki-NLP/opus-mt-en-ru")
|
18 |
|
19 |
# Create speech from rus text
|
20 |
-
model = VitsModel.from_pretrained("
|
21 |
-
tokenizer = VitsTokenizer.from_pretrained("
|
22 |
|
23 |
#model = MarianMTModel.from_pretrained("Helsinki-NLP/opus-mt-ru-en")
|
24 |
#tokenizer = MarianTokenizer.from_pretrained("Helsinki-NLP/opus-mt-ru-en")
|
|
|
|
|
1 |
|
2 |
import gradio as gr
|
3 |
import numpy as np
|
|
|
10 |
device = "cuda:0" if torch.cuda.is_available() else "cpu"
|
11 |
|
12 |
# Transform audio to en text
|
13 |
+
asr_pipe = pipeline("automatic-speech-recognition", model="asapp/sew-d-tiny-400k-ft-ls100h", device=device)
|
14 |
|
15 |
# Translate en to rus text
|
16 |
translation_en_to_rus = pipeline("translation", model="Helsinki-NLP/opus-mt-en-ru")
|
17 |
|
18 |
# Create speech from rus text
|
19 |
+
model = VitsModel.from_pretrained("facebook/mms-tts-rus")
|
20 |
+
tokenizer = VitsTokenizer.from_pretrained("facebook/mms-tts-rus")
|
21 |
|
22 |
#model = MarianMTModel.from_pretrained("Helsinki-NLP/opus-mt-ru-en")
|
23 |
#tokenizer = MarianTokenizer.from_pretrained("Helsinki-NLP/opus-mt-ru-en")
|