kfahn commited on
Commit
34071c9
1 Parent(s): ce15b7e

Update app.py

Browse files

Change language to Spanish

Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -20,11 +20,11 @@ asr_pipe = pipeline("automatic-speech-recognition", model="openai/whisper-base",
20
 
21
 
22
  #processor = SpeechT5Processor.from_pretrained("microsoft/speecht5_tts")
23
- processor = SpeechT5Processor.from_pretrained("kfahn/speecht5_finetuned_voxpopuli_cs")
24
  #processor = SpeechT5Processor.from_pretrained("sanchit-gandhi/speecht5_tts_vox_nl")
25
 
26
  #model = SpeechT5ForTextToSpeech.from_pretrained("sanchit-gandhi/speecht5_tts_vox_nl").to(device)
27
- model = SpeechT5ForTextToSpeech.from_pretrained("kfahn/speecht5_finetuned_voxpopuli_cs").to(device)
28
  #model = SpeechT5ForTextToSpeech.from_pretrained("microsoft/speecht5_tts").to(device)
29
  vocoder = SpeechT5HifiGan.from_pretrained("microsoft/speecht5_hifigan").to(device)
30
 
@@ -33,7 +33,7 @@ speaker_embeddings = torch.tensor(embeddings_dataset[7306]["xvector"]).unsqueeze
33
 
34
 
35
  def translate(audio):
36
- outputs = asr_pipe(audio, max_new_tokens=256, generate_kwargs={"task": "transcribe", "language": "de"})
37
  return outputs["text"]
38
 
39
 
 
20
 
21
 
22
  #processor = SpeechT5Processor.from_pretrained("microsoft/speecht5_tts")
23
+ processor = SpeechT5Processor.from_pretrained("kfahn/speecht5_finetuned_voxpopuli_es")
24
  #processor = SpeechT5Processor.from_pretrained("sanchit-gandhi/speecht5_tts_vox_nl")
25
 
26
  #model = SpeechT5ForTextToSpeech.from_pretrained("sanchit-gandhi/speecht5_tts_vox_nl").to(device)
27
+ model = SpeechT5ForTextToSpeech.from_pretrained("kfahn/speecht5_finetuned_voxpopuli_es").to(device)
28
  #model = SpeechT5ForTextToSpeech.from_pretrained("microsoft/speecht5_tts").to(device)
29
  vocoder = SpeechT5HifiGan.from_pretrained("microsoft/speecht5_hifigan").to(device)
30
 
 
33
 
34
 
35
  def translate(audio):
36
+ outputs = asr_pipe(audio, max_new_tokens=256, generate_kwargs={"task": "transcribe", "language": "es"})
37
  return outputs["text"]
38
 
39