Spaces:
Sleeping
Sleeping
Updated app
Browse files
app.py
CHANGED
@@ -59,14 +59,10 @@ if st.button("Generate Music"):
|
|
59 |
with st.spinner("Generating audio..."):
|
60 |
results = generate_audio(processor, model, prompt)
|
61 |
if results is not None:
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
with open(filename, "rb") as f:
|
67 |
-
generation = f.read()
|
68 |
-
st.write("Listen to the generated music:")
|
69 |
-
st.audio(generation)
|
70 |
|
71 |
# Add additional information and instructions for users
|
72 |
st.sidebar.subheader("How to Use:")
|
|
|
59 |
with st.spinner("Generating audio..."):
|
60 |
results = generate_audio(processor, model, prompt)
|
61 |
if results is not None:
|
62 |
+
sampling_rate = model.config.audio_encoder.sampling_rate
|
63 |
+
st.write("Listen to the generated music:")
|
64 |
+
st.audio(sample_rate=sampling_rate, data=results[0, 0].cpu().numpy(), format="audio/wav")
|
65 |
+
|
|
|
|
|
|
|
|
|
66 |
|
67 |
# Add additional information and instructions for users
|
68 |
st.sidebar.subheader("How to Use:")
|