Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -222,9 +222,9 @@ def generate_and_return_files(bpm, temperature, top_k, uploaded_sf2=None, output
|
|
| 222 |
|
| 223 |
|
| 224 |
custom_css = """
|
| 225 |
-
|
| 226 |
max-width: 1200px !important;
|
| 227 |
-
margin: 0 auto
|
| 228 |
}
|
| 229 |
|
| 230 |
#generate-btn {
|
|
@@ -251,26 +251,27 @@ waveform_opts = gr.WaveformOptions(
|
|
| 251 |
)
|
| 252 |
|
| 253 |
with gr.Blocks(css=custom_css, theme="monochrome") as iface:
|
| 254 |
-
gr.
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
|
| 258 |
-
with gr.
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
|
|
|
|
| 275 |
|
| 276 |
iface.launch(share=True)
|
|
|
|
| 222 |
|
| 223 |
|
| 224 |
custom_css = """
|
| 225 |
+
#main-container {
|
| 226 |
max-width: 1200px !important;
|
| 227 |
+
margin: 0 auto;
|
| 228 |
}
|
| 229 |
|
| 230 |
#generate-btn {
|
|
|
|
| 251 |
)
|
| 252 |
|
| 253 |
with gr.Blocks(css=custom_css, theme="monochrome") as iface:
|
| 254 |
+
with gr.Column(elem_id="main-container"):
|
| 255 |
+
gr.Markdown("<h1 style='font-weight: bold; text-align: center; font-size: 40px; margin: 0px;'>nanoMPC</h1>")
|
| 256 |
+
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>")
|
| 257 |
+
|
| 258 |
+
with gr.Row():
|
| 259 |
+
with gr.Column(scale=1):
|
| 260 |
+
bpm = gr.Slider(minimum=50, maximum=200, step=1, value=100, label="BPM")
|
| 261 |
+
temperature = gr.Slider(minimum=0.1, maximum=2.0, step=0.1, value=1.0, label="Temperature")
|
| 262 |
+
top_k = gr.Slider(minimum=4, maximum=16, step=1, value=8, label="Top-k")
|
| 263 |
+
output_level = gr.Slider(minimum=0, maximum=3, step=0.10, value=2.0, label="Output Gain")
|
| 264 |
+
midi_file = gr.File(label="MIDI Output")
|
| 265 |
+
audio_file = gr.Audio(label="Audio Output", type="filepath", waveform_options=waveform_opts)
|
| 266 |
+
generate_button = gr.Button("Generate", elem_id="generate-btn")
|
| 267 |
+
soundfont = gr.File(label="Optional: Upload SoundFont (preset=0, bank=0)")
|
| 268 |
+
|
| 269 |
+
generate_button.click(
|
| 270 |
+
fn=generate_and_return_files,
|
| 271 |
+
inputs=[bpm, temperature, top_k, soundfont, output_level],
|
| 272 |
+
outputs=[midi_file, audio_file]
|
| 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)
|