revolunet commited on
Commit
4f185fe
1 Parent(s): 7fee4a9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -11,7 +11,7 @@ device = "cuda:0" if torch.cuda.is_available() else "cpu"
11
  asr_pipe = pipeline("automatic-speech-recognition", model="openai/whisper-large-v2", device=device)
12
 
13
  # load text-to-speech checkpoint and speaker embeddings
14
- model_id = "Sandiago21/speecht5_finetuned_voxpopuli_it" # 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")
@@ -47,7 +47,7 @@ def synthesize_speech(text):
47
  return gr.Audio.update(value=(16000, speech.cpu().numpy()))
48
 
49
  def translate(audio):
50
- outputs = asr_pipe(audio, max_new_tokens=256, generate_kwargs={"task": "transcribe", "language": "italian"})
51
  return outputs["text"]
52
 
53
 
 
11
  asr_pipe = pipeline("automatic-speech-recognition", model="openai/whisper-large-v2", device=device)
12
 
13
  # load text-to-speech checkpoint and speaker embeddings
14
+ model_id = "Sandiago21/speecht5_finetuned_facebook_voxpopuli_french" # 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")
 
47
  return gr.Audio.update(value=(16000, speech.cpu().numpy()))
48
 
49
  def translate(audio):
50
+ outputs = asr_pipe(audio, max_new_tokens=256, generate_kwargs={"task": "transcribe", "language": "french"})
51
  return outputs["text"]
52
 
53