testing new bs
Browse files- app_batched.py +3 -3
app_batched.py
CHANGED
@@ -58,8 +58,8 @@ def predict(texts, melodies):
|
|
58 |
for output in outputs:
|
59 |
with NamedTemporaryFile("wb", suffix=".wav", delete=False) as file:
|
60 |
audio_write(file.name, output, MODEL.sample_rate, strategy="loudness", add_suffix=False)
|
61 |
-
out_files.append(
|
62 |
-
return out_files
|
63 |
|
64 |
|
65 |
with gr.Blocks() as demo:
|
@@ -99,7 +99,7 @@ with gr.Blocks() as demo:
|
|
99 |
submit = gr.Button("Submit")
|
100 |
with gr.Column():
|
101 |
output = gr.Audio(label="Generated Music", type="filepath", format="wav")
|
102 |
-
submit.click(predict, inputs=[text, melody], outputs=[output], batch=True, max_batch_size=
|
103 |
gr.Examples(
|
104 |
fn=predict,
|
105 |
examples=[
|
|
|
58 |
for output in outputs:
|
59 |
with NamedTemporaryFile("wb", suffix=".wav", delete=False) as file:
|
60 |
audio_write(file.name, output, MODEL.sample_rate, strategy="loudness", add_suffix=False)
|
61 |
+
out_files.append(file.name)
|
62 |
+
return [out_files]
|
63 |
|
64 |
|
65 |
with gr.Blocks() as demo:
|
|
|
99 |
submit = gr.Button("Submit")
|
100 |
with gr.Column():
|
101 |
output = gr.Audio(label="Generated Music", type="filepath", format="wav")
|
102 |
+
submit.click(predict, inputs=[text, melody], outputs=[output], batch=True, max_batch_size=12)
|
103 |
gr.Examples(
|
104 |
fn=predict,
|
105 |
examples=[
|