jason1i commited on
Commit
9cf5830
·
1 Parent(s): f7e21c8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -9,7 +9,7 @@ from transformers import SpeechT5ForTextToSpeech, SpeechT5HifiGan, SpeechT5Proce
9
  device = "cuda:0" if torch.cuda.is_available() else "cpu"
10
 
11
  # load speech translation checkpoint
12
- asr_pipe = pipeline("automatic-speech-recognition", model="openai/whisper-base", device=device,ignore_mismatched_sizes=True)
13
 
14
  # load text-to-speech checkpoint and speaker embeddings
15
  #processor = SpeechT5Processor.from_pretrained("microsoft/speecht5_tts")
@@ -22,7 +22,7 @@ processor = SpeechT5Processor.from_pretrained("sanchit-gandhi/speecht5_tts_vox_n
22
  #model = SpeechT5ForTextToSpeech.from_pretrained("jasonl1/speecht5_finetuned_voxpopuli_fi")
23
  model = SpeechT5ForTextToSpeech.from_pretrained("sanchit-gandhi/speecht5_tts_vox_nl",ignore_mismatched_sizes=True)
24
 
25
- vocoder = SpeechT5HifiGan.from_pretrained("microsoft/speecht5_hifigan").to(device)
26
 
27
  embeddings_dataset = load_dataset("Matthijs/cmu-arctic-xvectors", split="validation")
28
  speaker_embeddings = torch.tensor(embeddings_dataset[7306]["xvector"]).unsqueeze(0)
 
9
  device = "cuda:0" if torch.cuda.is_available() else "cpu"
10
 
11
  # load speech translation checkpoint
12
+ asr_pipe = pipeline("automatic-speech-recognition", model="openai/whisper-base", device=device)
13
 
14
  # load text-to-speech checkpoint and speaker embeddings
15
  #processor = SpeechT5Processor.from_pretrained("microsoft/speecht5_tts")
 
22
  #model = SpeechT5ForTextToSpeech.from_pretrained("jasonl1/speecht5_finetuned_voxpopuli_fi")
23
  model = SpeechT5ForTextToSpeech.from_pretrained("sanchit-gandhi/speecht5_tts_vox_nl",ignore_mismatched_sizes=True)
24
 
25
+ vocoder = SpeechT5HifiGan.from_pretrained("microsoft/speecht5_hifigan",ignore_mismatched_sizes=True).to(device)
26
 
27
  embeddings_dataset = load_dataset("Matthijs/cmu-arctic-xvectors", split="validation")
28
  speaker_embeddings = torch.tensor(embeddings_dataset[7306]["xvector"]).unsqueeze(0)