ahk-d commited on
Commit
250f4e9
Β·
verified Β·
1 Parent(s): cba070b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -31
app.py CHANGED
@@ -99,8 +99,7 @@ def create_hf_interface():
99
  # Input
100
  audio_input = gr.Audio(
101
  type="filepath",
102
- label="🎼 Upload Music File",
103
- info="Supported: MP3, WAV, FLAC (max 10MB recommended)"
104
  )
105
 
106
  model_choice = gr.Dropdown(
@@ -110,14 +109,12 @@ def create_hf_interface():
110
  ("MDX Extra (4 stems)", "mdx_extra")
111
  ],
112
  value="htdemucs",
113
- label="πŸ€– Model",
114
- info="Choose separation model"
115
  )
116
 
117
  separate_btn = gr.Button(
118
  "πŸŽ›οΈ Separate Stems",
119
- variant="primary",
120
- size="lg"
121
  )
122
 
123
  with gr.Column():
@@ -139,8 +136,7 @@ def create_hf_interface():
139
  # Status
140
  status_output = gr.Textbox(
141
  label="Status",
142
- interactive=False,
143
- show_label=True
144
  )
145
 
146
  # Output stems
@@ -149,28 +145,24 @@ def create_hf_interface():
149
  with gr.Row():
150
  drums_output = gr.Audio(
151
  label="πŸ₯ Drums",
152
- interactive=False,
153
- show_download_button=True
154
  )
155
  bass_output = gr.Audio(
156
  label="🎸 Bass",
157
- interactive=False,
158
- show_download_button=True
159
  )
160
 
161
  with gr.Row():
162
  other_output = gr.Audio(
163
  label="🎹 Other",
164
- interactive=False,
165
- show_download_button=True
166
  )
167
  vocals_output = gr.Audio(
168
  label="🎀 Vocals",
169
- interactive=False,
170
- show_download_button=True
171
  )
172
 
173
- # Connect the interface
174
  separate_btn.click(
175
  fn=separate_stems,
176
  inputs=[audio_input, model_choice],
@@ -180,22 +172,20 @@ def create_hf_interface():
180
  other_output,
181
  vocals_output,
182
  status_output
183
- ],
184
- show_progress=True
185
  )
186
 
187
- # Examples
188
- gr.Markdown("### 🎡 Try with example audio")
189
- gr.Examples(
190
- examples=[
191
- ["example1.wav", "htdemucs"],
192
- ["example2.mp3", "htdemucs"],
193
- ],
194
- inputs=[audio_input, model_choice],
195
- outputs=[drums_output, bass_output, other_output, vocals_output, status_output],
196
- fn=separate_stems,
197
- cache_examples=False
198
- )
199
 
200
  gr.Markdown("""
201
  ---
 
99
  # Input
100
  audio_input = gr.Audio(
101
  type="filepath",
102
+ label="🎼 Upload Music File"
 
103
  )
104
 
105
  model_choice = gr.Dropdown(
 
109
  ("MDX Extra (4 stems)", "mdx_extra")
110
  ],
111
  value="htdemucs",
112
+ label="πŸ€– Model"
 
113
  )
114
 
115
  separate_btn = gr.Button(
116
  "πŸŽ›οΈ Separate Stems",
117
+ variant="primary"
 
118
  )
119
 
120
  with gr.Column():
 
136
  # Status
137
  status_output = gr.Textbox(
138
  label="Status",
139
+ interactive=False
 
140
  )
141
 
142
  # Output stems
 
145
  with gr.Row():
146
  drums_output = gr.Audio(
147
  label="πŸ₯ Drums",
148
+ interactive=False
 
149
  )
150
  bass_output = gr.Audio(
151
  label="🎸 Bass",
152
+ interactive=False
 
153
  )
154
 
155
  with gr.Row():
156
  other_output = gr.Audio(
157
  label="🎹 Other",
158
+ interactive=False
 
159
  )
160
  vocals_output = gr.Audio(
161
  label="🎀 Vocals",
162
+ interactive=False
 
163
  )
164
 
165
+ # Connect the interface
166
  separate_btn.click(
167
  fn=separate_stems,
168
  inputs=[audio_input, model_choice],
 
172
  other_output,
173
  vocals_output,
174
  status_output
175
+ ]
 
176
  )
177
 
178
+ # Examples - simplified for older Gradio
179
+ gr.Markdown("""
180
+ ### 🎡 Instructions
181
+ 1. Upload an audio file (MP3, WAV, FLAC)
182
+ 2. Choose a separation model
183
+ 3. Click "Separate Stems"
184
+ 4. Download individual tracks when ready
185
+
186
+ **Supported formats**: MP3, WAV, FLAC (max 50MB)
187
+ **Processing time**: 1-5 minutes depending on file length
188
+ """)
 
189
 
190
  gr.Markdown("""
191
  ---