annabeth97c commited on
Commit
cd1e276
·
verified ·
1 Parent(s): 1bbd78d

feat: Make app more informative

Browse files
Files changed (1) hide show
  1. app.py +30 -7
app.py CHANGED
@@ -157,13 +157,36 @@ def generate_caption(audio_file):
157
  return outputs
158
 
159
 
160
- demo = gr.Interface(
161
- fn=caption_audio,
162
- inputs=gr.Audio(type="filepath", label="Upload an audio file"),
163
- outputs=gr.Textbox(label="Generated Caption"),
164
- title="SonicVerse",
165
- description="Upload an audio file to generate a caption using SonicVerse"
166
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
167
 
168
  if __name__ == "__main__":
169
  demo.launch()
 
157
  return outputs
158
 
159
 
160
+ with gr.Blocks(title="SonicVerse") as demo:
161
+ gr.Markdown("""
162
+ # 🎼 SonicVerse: Music Captioning Demo
163
+
164
+ Welcome to **SonicVerse**, a multi-task music captioning model that provides natural language descriptions of input clips.
165
+
166
+ 🎵 Captions include music features such as:
167
+ - Genre
168
+ - Mood
169
+ - Instrumentation
170
+ - Vocals
171
+ - Key
172
+
173
+ 📘 [Read the Paper](https://arxiv.org/abs/2506.15154)
174
+
175
+ 🖥️ [Replicate locally](https://github.com/amaai-lab/SonicVerse)
176
+
177
+
178
+ ⚠️ **Note:** You can upload audio of any length, but due to compute limits on Hugging Face Spaces,
179
+ it is recommended to keep clips under 30 seconds unless you have a Pro account or run this locally.
180
+ """)
181
+
182
+ with gr.Row():
183
+ audio_input = gr.Audio(type="filepath", label="Upload your music clip")
184
+ caption_output = gr.Textbox(label="Generated Caption", lines=8)
185
+
186
+ submit_btn = gr.Button("Generate Caption")
187
+ submit_btn.click(fn=caption_audio, inputs=audio_input, outputs=caption_output)
188
+
189
+
190
 
191
  if __name__ == "__main__":
192
  demo.launch()