Spaces:
Runtime error
Runtime error
Upload app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
|
2 |
# !pip -q uninstall gradio -y
|
3 |
# !pip -q install gradio==3.50.2
|
@@ -14,7 +22,7 @@ from transformers import SpeechT5ForTextToSpeech, SpeechT5HifiGan, SpeechT5Proce
|
|
14 |
device = "cuda:0" if torch.cuda.is_available() else "cpu"
|
15 |
|
16 |
# load speech translation checkpoint
|
17 |
-
asr_pipe = pipeline("automatic-speech-recognition", model="
|
18 |
|
19 |
|
20 |
processor = WhisperProcessor.from_pretrained(
|
@@ -25,7 +33,6 @@ translator2 = pipeline("translation", model="Helsinki-NLP/opus-mt-en-ru")
|
|
25 |
|
26 |
from transformers import VitsModel, VitsTokenizer
|
27 |
|
28 |
-
|
29 |
model = VitsModel.from_pretrained("facebook/mms-tts-rus")
|
30 |
tokenizer = VitsTokenizer.from_pretrained("facebook/mms-tts-rus")
|
31 |
|
@@ -64,11 +71,6 @@ https://imgur.com/UNH5ym1
|
|
64 |
* Далее идет перевод с языка, на котором была запись, на английский, и после этого на русский
|
65 |
* Потом переведенный текст воспроизводится на русском языке
|
66 |
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
"""
|
73 |
|
74 |
demo = gr.Blocks()
|
|
|
1 |
+
# -*- coding: utf-8 -*-
|
2 |
+
"""HW3_ml.ipynb
|
3 |
+
|
4 |
+
Automatically generated by Colaboratory.
|
5 |
+
|
6 |
+
Original file is located at
|
7 |
+
https://colab.research.google.com/drive/1z4ht7K9pttbgWmDDnrQhqoZ6SYAiaeUe
|
8 |
+
"""
|
9 |
|
10 |
# !pip -q uninstall gradio -y
|
11 |
# !pip -q install gradio==3.50.2
|
|
|
22 |
device = "cuda:0" if torch.cuda.is_available() else "cpu"
|
23 |
|
24 |
# load speech translation checkpoint
|
25 |
+
asr_pipe = pipeline("automatic-speech-recognition", model="voidful/wav2vec2-xlsr-multilingual-56", device=device)
|
26 |
|
27 |
|
28 |
processor = WhisperProcessor.from_pretrained(
|
|
|
33 |
|
34 |
from transformers import VitsModel, VitsTokenizer
|
35 |
|
|
|
36 |
model = VitsModel.from_pretrained("facebook/mms-tts-rus")
|
37 |
tokenizer = VitsTokenizer.from_pretrained("facebook/mms-tts-rus")
|
38 |
|
|
|
71 |
* Далее идет перевод с языка, на котором была запись, на английский, и после этого на русский
|
72 |
* Потом переведенный текст воспроизводится на русском языке
|
73 |
|
|
|
|
|
|
|
|
|
|
|
74 |
"""
|
75 |
|
76 |
demo = gr.Blocks()
|