Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -250,28 +250,27 @@ waveform_opts = gr.WaveformOptions(
|
|
| 250 |
trim_region_color="#7c4dff"
|
| 251 |
)
|
| 252 |
|
| 253 |
-
with gr.Blocks(css=custom_css, theme="
|
| 254 |
-
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
|
| 258 |
-
with gr.
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
|
| 275 |
-
gr.Markdown("<p style='text-align: center; font-size: 14px;'>Developed by <a href='https://www.patchbanks.com/' target='_blank'><strong>Patchbanks</strong></a></p>")
|
| 276 |
|
| 277 |
iface.launch(share=True)
|
|
|
|
| 250 |
trim_region_color="#7c4dff"
|
| 251 |
)
|
| 252 |
|
| 253 |
+
with gr.Blocks(css=custom_css, theme=gr.themes.Default(font=[gr.themes.GoogleFont("Roboto"), "sans-serif"])) as iface:
|
| 254 |
+
gr.Markdown("<h1 style='font-weight: bold; text-align: center; font-size: 40px; margin: 0px;'>nanoMPC</h1>")
|
| 255 |
+
gr.Markdown("<p style='text-align: center; font-size: 18px;'>nanoMPC is a MIDI transformer model that generates lo-fi and boom bap beats.</p>")
|
| 256 |
+
|
| 257 |
+
with gr.Row():
|
| 258 |
+
with gr.Column(scale=1):
|
| 259 |
+
bpm = gr.Slider(minimum=50, maximum=200, step=1, value=100, label="BPM")
|
| 260 |
+
temperature = gr.Slider(minimum=0.1, maximum=2.0, step=0.1, value=1.0, label="Temperature")
|
| 261 |
+
top_k = gr.Slider(minimum=4, maximum=16, step=1, value=8, label="Top-k")
|
| 262 |
+
output_level = gr.Slider(minimum=0, maximum=3, step=0.10, value=2.0, label="Output Gain")
|
| 263 |
+
midi_file = gr.File(label="MIDI Output")
|
| 264 |
+
audio_file = gr.Audio(label="Audio Output", type="filepath", waveform_options=waveform_opts)
|
| 265 |
+
generate_button = gr.Button("Generate", elem_id="generate-btn")
|
| 266 |
+
soundfont = gr.File(label="Optional: Upload SoundFont (preset=0, bank=0)")
|
| 267 |
+
|
| 268 |
+
generate_button.click(
|
| 269 |
+
fn=generate_and_return_files,
|
| 270 |
+
inputs=[bpm, temperature, top_k, soundfont, output_level],
|
| 271 |
+
outputs=[midi_file, audio_file]
|
| 272 |
+
)
|
| 273 |
+
|
| 274 |
+
gr.Markdown("<p style='text-align: center; font-size: 14px;'>Developed by <a href='https://www.patchbanks.com/' target='_blank'><strong>Patchbanks</strong></a></p>")
|
|
|
|
| 275 |
|
| 276 |
iface.launch(share=True)
|