alessio21 commited on
Commit
58b290b
·
1 Parent(s): 1fb163a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -15,8 +15,8 @@ asr_pipe = pipeline("automatic-speech-recognition", model="openai/whisper-base",
15
  #processor = SpeechT5Processor.from_pretrained("microsoft/speecht5_tts")
16
  #model = SpeechT5ForTextToSpeech.from_pretrained("microsoft/speecht5_tts").to(device)
17
 
18
- processor = AutoProcessor.from_pretrained("sanchit-gandhi/speecht5_tts_vox_nl")
19
- model = SpeechT5ForTextToSpeech.from_pretrained("sanchit-gandhi/speecht5_tts_vox_nl").to(device)
20
 
21
  vocoder = SpeechT5HifiGan.from_pretrained("microsoft/speecht5_hifigan").to(device)
22
 
@@ -25,7 +25,7 @@ speaker_embeddings = torch.tensor(embeddings_dataset[7306]["xvector"]).unsqueeze
25
 
26
 
27
  def translate(audio):
28
- outputs = asr_pipe(audio, max_new_tokens=256, generate_kwargs={"task": "transcribe", "language": "nl"})
29
  return outputs["text"]
30
 
31
 
 
15
  #processor = SpeechT5Processor.from_pretrained("microsoft/speecht5_tts")
16
  #model = SpeechT5ForTextToSpeech.from_pretrained("microsoft/speecht5_tts").to(device)
17
 
18
+ processor = AutoProcessor.from_pretrained("kfahn/speecht5_finetuned_voxpopuli_es")
19
+ model = SpeechT5ForTextToSpeech.from_pretrained("kfahn/speecht5_finetuned_voxpopuli_es").to(device)
20
 
21
  vocoder = SpeechT5HifiGan.from_pretrained("microsoft/speecht5_hifigan").to(device)
22
 
 
25
 
26
 
27
  def translate(audio):
28
+ outputs = asr_pipe(audio, max_new_tokens=128, generate_kwargs={"task": "transcribe", "language": "es"})
29
  return outputs["text"]
30
 
31