lmzjms commited on
Commit
9bf0961
1 Parent(s): c52f81e

Update audio_foundation_models.py

Browse files
Files changed (1) hide show
  1. audio_foundation_models.py +2 -2
audio_foundation_models.py CHANGED
@@ -242,7 +242,7 @@ class I2A:
242
 
243
  class TTS:
244
  def __init__(self, device=None):
245
- self.inferencer = TTSInference(device)
246
 
247
  @prompts(name="Synthesize Speech Given the User Input Text",
248
  description="useful for when you want to convert a user input text into speech audio it saved it to a file."
@@ -251,7 +251,7 @@ class TTS:
251
 
252
  def inference(self, text):
253
  inp = {"text": text}
254
- out = self.inferencer.infer_once(inp)
255
  audio_filename = os.path.join('audio', str(uuid.uuid4())[0:8] + ".wav")
256
  soundfile.write(audio_filename, out, samplerate = 22050)
257
  return audio_filename
 
242
 
243
  class TTS:
244
  def __init__(self, device=None):
245
+ self.model = TTSInference(device)
246
 
247
  @prompts(name="Synthesize Speech Given the User Input Text",
248
  description="useful for when you want to convert a user input text into speech audio it saved it to a file."
 
251
 
252
  def inference(self, text):
253
  inp = {"text": text}
254
+ out = self.model.infer_once(inp)
255
  audio_filename = os.path.join('audio', str(uuid.uuid4())[0:8] + ".wav")
256
  soundfile.write(audio_filename, out, samplerate = 22050)
257
  return audio_filename