Update app.py
Browse files
app.py
CHANGED
@@ -11,12 +11,13 @@ device = "cuda:0" if torch.cuda.is_available() else "cpu"
|
|
11 |
asr_pipe = pipeline("automatic-speech-recognition", model="openai/whisper-tiny", device=device)
|
12 |
|
13 |
# load text-to-speech checkpoint and speaker embeddings
|
14 |
-
model_id = "Ellight/speecht5_finetuned_voxpopuli_nl" # update with your model id
|
15 |
# pipe = pipeline("automatic-speech-recognition", model=model_id)
|
16 |
model = SpeechT5ForTextToSpeech.from_pretrained(model_id)
|
17 |
vocoder = SpeechT5HifiGan.from_pretrained("microsoft/speecht5_hifigan")
|
18 |
-
embeddings_dataset = load_dataset("Matthijs/cmu-arctic-xvectors", split="validation",trust_remote_code=True)
|
19 |
-
speaker_embeddings = torch.tensor(embeddings_dataset[
|
|
|
20 |
|
21 |
processor = SpeechT5Processor.from_pretrained(model_id)
|
22 |
|
|
|
11 |
asr_pipe = pipeline("automatic-speech-recognition", model="openai/whisper-tiny", device=device)
|
12 |
|
13 |
# load text-to-speech checkpoint and speaker embeddings
|
14 |
+
model_id = "microsoft/speecht5_tts" #"Ellight/speecht5_finetuned_voxpopuli_nl" # update with your model id
|
15 |
# pipe = pipeline("automatic-speech-recognition", model=model_id)
|
16 |
model = SpeechT5ForTextToSpeech.from_pretrained(model_id)
|
17 |
vocoder = SpeechT5HifiGan.from_pretrained("microsoft/speecht5_hifigan")
|
18 |
+
embeddings_dataset = load_dataset("Matthijs/cmu-arctic-xvectors", split="validation",trust_remote_code=True))
|
19 |
+
speaker_embeddings = torch.tensor(embeddings_dataset[7306]["xvector"]).unsqueeze(0)
|
20 |
+
# speaker_embeddings = torch.tensor(embeddings_dataset[7440]["xvector"]).unsqueeze(0)
|
21 |
|
22 |
processor = SpeechT5Processor.from_pretrained(model_id)
|
23 |
|