Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
4c3670f
1
Parent(s):
2c1e8f3
simplify the UI further
Browse files- app.py +0 -17
- ui/simple_components.py +2 -1
app.py
CHANGED
|
@@ -89,23 +89,6 @@ def main(args):
|
|
| 89 |
|
| 90 |
# Add API endpoint to the demo
|
| 91 |
demo.api_open = True
|
| 92 |
-
demo.api_name = "/generate_music"
|
| 93 |
-
|
| 94 |
-
# Make the API function available
|
| 95 |
-
with demo:
|
| 96 |
-
gr.Interface(
|
| 97 |
-
fn=generate_music_api,
|
| 98 |
-
inputs=[
|
| 99 |
-
gr.Number(value=20, label="Duration (seconds)"),
|
| 100 |
-
gr.Textbox(value="edm, synth, bass, 128 bpm, energetic", label="Tags"),
|
| 101 |
-
gr.Textbox(value="[instrumental]", label="Lyrics"),
|
| 102 |
-
gr.Number(value=60, label="Inference Steps"),
|
| 103 |
-
gr.Number(value=15.0, label="Guidance Scale"),
|
| 104 |
-
],
|
| 105 |
-
outputs=gr.Audio(type="filepath", label="Generated Music"),
|
| 106 |
-
api_name="generate",
|
| 107 |
-
visible=False # Hide this interface, it's only for API
|
| 108 |
-
)
|
| 109 |
|
| 110 |
demo.queue(default_concurrency_limit=8).launch(
|
| 111 |
server_name=args.server_name,
|
|
|
|
| 89 |
|
| 90 |
# Add API endpoint to the demo
|
| 91 |
demo.api_open = True
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 92 |
|
| 93 |
demo.queue(default_concurrency_limit=8).launch(
|
| 94 |
server_name=args.server_name,
|
ui/simple_components.py
CHANGED
|
@@ -84,7 +84,8 @@ def create_simple_ui(text2music_process_func):
|
|
| 84 |
generate_btn.click(
|
| 85 |
fn=process_simple,
|
| 86 |
inputs=[duration, preset],
|
| 87 |
-
outputs=[output_audio, output_info]
|
|
|
|
| 88 |
)
|
| 89 |
|
| 90 |
return demo
|
|
|
|
| 84 |
generate_btn.click(
|
| 85 |
fn=process_simple,
|
| 86 |
inputs=[duration, preset],
|
| 87 |
+
outputs=[output_audio, output_info],
|
| 88 |
+
api_name="generate" # This makes it available as API endpoint
|
| 89 |
)
|
| 90 |
|
| 91 |
return demo
|