Spaces:
Runtime error
Runtime error
Commit
•
f63ec58
1
Parent(s):
dbfdf1a
Update app.py
Browse files
app.py
CHANGED
@@ -9,12 +9,16 @@ from transformers import SpeechT5ForTextToSpeech, SpeechT5HifiGan, SpeechT5Proce
|
|
9 |
device = "cuda:0" if torch.cuda.is_available() else "cpu"
|
10 |
|
11 |
# load speech translation checkpoint
|
12 |
-
|
|
|
|
|
13 |
|
14 |
# load text-to-speech checkpoint and speaker embeddings
|
15 |
-
processor = SpeechT5Processor.from_pretrained("microsoft/speecht5_tts")
|
|
|
|
|
16 |
|
17 |
-
model = SpeechT5ForTextToSpeech.from_pretrained("
|
18 |
vocoder = SpeechT5HifiGan.from_pretrained("microsoft/speecht5_hifigan").to(device)
|
19 |
|
20 |
embeddings_dataset = load_dataset("Matthijs/cmu-arctic-xvectors", split="validation")
|
|
|
9 |
device = "cuda:0" if torch.cuda.is_available() else "cpu"
|
10 |
|
11 |
# load speech translation checkpoint
|
12 |
+
|
13 |
+
|
14 |
+
asr_pipe = pipeline("automatic-speech-recognition", model="openai/whisper-base", device=device, generate_kwargs = {task : "transcribe", language = swahili})
|
15 |
|
16 |
# load text-to-speech checkpoint and speaker embeddings
|
17 |
+
# processor = SpeechT5Processor.from_pretrained("microsoft/speecht5_tts")
|
18 |
+
processor = SpeechT5Processor.from_pretrained("samuelleecong/speecht5_finetuned_swahili")
|
19 |
+
|
20 |
|
21 |
+
model = SpeechT5ForTextToSpeech.from_pretrained("samuelleecong/speecht5_finetuned_swahili").to(device)
|
22 |
vocoder = SpeechT5HifiGan.from_pretrained("microsoft/speecht5_hifigan").to(device)
|
23 |
|
24 |
embeddings_dataset = load_dataset("Matthijs/cmu-arctic-xvectors", split="validation")
|