Spaces:
Build error
Build error
Update audio_foundation_models.py
Browse files
audio_foundation_models.py
CHANGED
@@ -242,7 +242,7 @@ class I2A:
|
|
242 |
|
243 |
class TTS:
|
244 |
def __init__(self, device=None):
|
245 |
-
self.
|
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.
|
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
|