ljcortesr
commited on
Commit
·
fa27227
1
Parent(s):
eced700
back genAudio Debug
Browse files
app.py
CHANGED
|
@@ -12,8 +12,7 @@ os.makedirs(OUTPUT_DIR, exist_ok=True)
|
|
| 12 |
model = None
|
| 13 |
|
| 14 |
@spaces.GPU
|
| 15 |
-
def generate_audio(descriptions: str, duration: int = DEFAULT_DURATION):
|
| 16 |
-
print(f"[DEBUG] Received API call: '{descriptions}' duration={duration}")
|
| 17 |
global model
|
| 18 |
if model is None:
|
| 19 |
model = AudioGen.get_pretrained('facebook/audiogen-medium')
|
|
@@ -23,7 +22,7 @@ def generate_audio(descriptions: str, duration: int = DEFAULT_DURATION):
|
|
| 23 |
model.set_generation_params(duration=duration)
|
| 24 |
wav = model.generate([descriptions])
|
| 25 |
results = []
|
| 26 |
-
|
| 27 |
for one_wav in wav:
|
| 28 |
filename = f'{descriptions}.wav'
|
| 29 |
file_path = os.path.join('audio_files', filename)
|
|
|
|
| 12 |
model = None
|
| 13 |
|
| 14 |
@spaces.GPU
|
| 15 |
+
def generate_audio(descriptions: str, duration: int = DEFAULT_DURATION):
|
|
|
|
| 16 |
global model
|
| 17 |
if model is None:
|
| 18 |
model = AudioGen.get_pretrained('facebook/audiogen-medium')
|
|
|
|
| 22 |
model.set_generation_params(duration=duration)
|
| 23 |
wav = model.generate([descriptions])
|
| 24 |
results = []
|
| 25 |
+
print(f"Received call: '{descriptions}' duration={duration}")
|
| 26 |
for one_wav in wav:
|
| 27 |
filename = f'{descriptions}.wav'
|
| 28 |
file_path = os.path.join('audio_files', filename)
|