lmzjms commited on
Commit
189fb81
·
1 Parent(s): b84694b

Update audio_foundation_models.py

Browse files
Files changed (1) hide show
  1. audio_foundation_models.py +4 -0
audio_foundation_models.py CHANGED
@@ -515,6 +515,10 @@ class ASR:
515
  options = whisper.DecodingOptions()
516
  result = whisper.decode(self.model, mel, options)
517
  return result.text
 
 
 
 
518
 
519
  class A2T:
520
  def __init__(self, device):
 
515
  options = whisper.DecodingOptions()
516
  result = whisper.decode(self.model, mel, options)
517
  return result.text
518
+
519
+ def translate_english(self, audio_path):
520
+ audio = self.model.transcribe(audio_path, language='English')
521
+ return audio['text']
522
 
523
  class A2T:
524
  def __init__(self, device):