YCHuang2112
commited on
Commit
·
3316cf6
1
Parent(s):
e701653
Update app.py
Browse files
app.py
CHANGED
@@ -23,8 +23,8 @@ processor = SpeechT5Processor.from_pretrained("sanchit-gandhi/speecht5_tts_vox_n
|
|
23 |
model = SpeechT5ForTextToSpeech.from_pretrained("sanchit-gandhi/speecht5_tts_vox_nl").to(device)
|
24 |
vocoder = SpeechT5HifiGan.from_pretrained("sanchit-gandhi/speecht5_tts_vox_nl").to(device)
|
25 |
|
26 |
-
|
27 |
-
|
28 |
|
29 |
spk_model_name = "speechbrain/spkrec-xvect-voxceleb"
|
30 |
|
@@ -49,7 +49,7 @@ speaker_embeddings_list = []
|
|
49 |
|
50 |
for i, data in enumerate(iter(dataset_nl)):
|
51 |
# print(i)
|
52 |
-
if(i >
|
53 |
break
|
54 |
data_list.append(data)
|
55 |
# data = next(iter(dataset_nl))
|
@@ -60,7 +60,7 @@ for i, data in enumerate(iter(dataset_nl)):
|
|
60 |
speaker_embeddings_list.append(speaker_embeddings)
|
61 |
|
62 |
|
63 |
-
speaker_embeddings = speaker_embeddings_list[
|
64 |
|
65 |
def translate(audio):
|
66 |
# outputs = asr_pipe(audio, max_new_tokens=256, generate_kwargs={"task": "translate"})
|
|
|
23 |
model = SpeechT5ForTextToSpeech.from_pretrained("sanchit-gandhi/speecht5_tts_vox_nl").to(device)
|
24 |
vocoder = SpeechT5HifiGan.from_pretrained("sanchit-gandhi/speecht5_tts_vox_nl").to(device)
|
25 |
|
26 |
+
embeddings_dataset = load_dataset("Matthijs/cmu-arctic-xvectors", split="validation")
|
27 |
+
speaker_embeddings = torch.tensor(embeddings_dataset[7306]["xvector"]).unsqueeze(0)
|
28 |
|
29 |
spk_model_name = "speechbrain/spkrec-xvect-voxceleb"
|
30 |
|
|
|
49 |
|
50 |
for i, data in enumerate(iter(dataset_nl)):
|
51 |
# print(i)
|
52 |
+
if(i > 16):
|
53 |
break
|
54 |
data_list.append(data)
|
55 |
# data = next(iter(dataset_nl))
|
|
|
60 |
speaker_embeddings_list.append(speaker_embeddings)
|
61 |
|
62 |
|
63 |
+
speaker_embeddings = speaker_embeddings_list[11]
|
64 |
|
65 |
def translate(audio):
|
66 |
# outputs = asr_pipe(audio, max_new_tokens=256, generate_kwargs={"task": "translate"})
|