Spaces:
Sleeping
Sleeping
Tirath5504
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -44,16 +44,24 @@ examples = [
|
|
44 |
"Heartful EDM with beautiful synths and chords",
|
45 |
]
|
46 |
|
47 |
-
st.
|
48 |
-
selected_example = st.
|
49 |
|
50 |
if st.button("Generate Audio"):
|
51 |
if selected_example or text_prompt:
|
|
|
|
|
|
|
|
|
|
|
52 |
with st.spinner("Generating audio..."):
|
53 |
-
audio_output = generate(
|
54 |
st.audio(audio_output, format='audio/wav')
|
55 |
else:
|
56 |
st.warning("Please select or enter a text prompt.")
|
57 |
|
58 |
if st.checkbox("Show debug info"):
|
59 |
-
|
|
|
|
|
|
|
|
44 |
"Heartful EDM with beautiful synths and chords",
|
45 |
]
|
46 |
|
47 |
+
st.title("Examples")
|
48 |
+
selected_example = st.radio("Select an example", examples)
|
49 |
|
50 |
if st.button("Generate Audio"):
|
51 |
if selected_example or text_prompt:
|
52 |
+
prompt = ""
|
53 |
+
if selected_example:
|
54 |
+
prompt = selected_example
|
55 |
+
else:
|
56 |
+
prompt = text_prompt
|
57 |
with st.spinner("Generating audio..."):
|
58 |
+
audio_output = generate(prompt)
|
59 |
st.audio(audio_output, format='audio/wav')
|
60 |
else:
|
61 |
st.warning("Please select or enter a text prompt.")
|
62 |
|
63 |
if st.checkbox("Show debug info"):
|
64 |
+
if text_prompt:
|
65 |
+
st.write("Text Prompt:", text_prompt)
|
66 |
+
if selected_example:
|
67 |
+
st.write("Text Prompt:", selected_example)
|