Tirath5504 commited on
Commit
938dda2
·
verified ·
1 Parent(s): e03464f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -4
app.py CHANGED
@@ -44,16 +44,24 @@ examples = [
44
  "Heartful EDM with beautiful synths and chords",
45
  ]
46
 
47
- st.sidebar.title("Examples")
48
- selected_example = st.sidebar.radio("Select an example", examples)
49
 
50
  if st.button("Generate Audio"):
51
  if selected_example or text_prompt:
 
 
 
 
 
52
  with st.spinner("Generating audio..."):
53
- audio_output = generate(selected_example)
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
- st.write("Text Prompt:", text_prompt)
 
 
 
 
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)