Spaces:
Runtime error
Runtime error
Commit
•
5989ff4
1
Parent(s):
b211a70
Update app.py
Browse files
app.py
CHANGED
@@ -5,6 +5,9 @@ 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 |
|
@@ -13,9 +16,6 @@ device = "cuda:0" if torch.cuda.is_available() else "cpu"
|
|
13 |
|
14 |
asr_pipe = pipeline("automatic-speech-recognition", model="openai/whisper-base", device=device, generate_kwargs = {"task": "translate"})
|
15 |
|
16 |
-
from transformers import M2M100ForConditionalGeneration
|
17 |
-
from tokenization_small100 import SMALL100Tokenizer
|
18 |
-
|
19 |
model = M2M100ForConditionalGeneration.from_pretrained("alirezamsh/small100")
|
20 |
tokenizer = M2M100Tokenizer.from_pretrained("alirezamsh/small100", tgt_lang="sw")
|
21 |
|
|
|
5 |
|
6 |
from transformers import SpeechT5ForTextToSpeech, SpeechT5HifiGan, SpeechT5Processor, pipeline
|
7 |
|
8 |
+
from transformers import M2M100ForConditionalGeneration
|
9 |
+
from small100.tokenization_small100 import SMALL100Tokenizer
|
10 |
+
|
11 |
|
12 |
device = "cuda:0" if torch.cuda.is_available() else "cpu"
|
13 |
|
|
|
16 |
|
17 |
asr_pipe = pipeline("automatic-speech-recognition", model="openai/whisper-base", device=device, generate_kwargs = {"task": "translate"})
|
18 |
|
|
|
|
|
|
|
19 |
model = M2M100ForConditionalGeneration.from_pretrained("alirezamsh/small100")
|
20 |
tokenizer = M2M100Tokenizer.from_pretrained("alirezamsh/small100", tgt_lang="sw")
|
21 |
|