import streamlit as st page_bg_img = f""" """ st.markdown(page_bg_img, unsafe_allow_html=True) audioldm_exmples_input_paths = [] audioldm_exmples_original_paths = [] exmples_prompts = ["wiwi", "pipi", "wifi"] st.title('Drums Generation in Different Models') st.subheader('Upload your audio file to process with AudioLDM2 or StableAudio') uploaded_file = st.file_uploader("Choose an audio file", type=["wav", "mp3", "ogg"]) model_choice = st.selectbox('Choose a model for processing', ('AudioLDM2', 'StableAudio')) prompt_text = st.text_input('Enter a prompt for the audio processing') start_point = st.slider('Choose a starting point for the audio (seconds)', 0.0, 60.0, 0.0) output_length = st.slider('Choose the length of the output audio (seconds)', 1.0, 60.0, 10.0) st.markdown('**Note:** Longer audio takes more time to generate.') if uploaded_file is not None and prompt_text: st.audio(uploaded_file, format="audio/mpeg") # Dummy processing function to demonstrate functionality def process_audio(file, model, prompt, start, length): # Replace this with actual audio processing code processed_audio_path = "processed_audio.wav" return processed_audio_path if st.button('Process Audio'): processed_audio = process_audio(uploaded_file, model_choice, prompt_text, start_point, output_length) st.audio(processed_audio, format="audio/mpeg", loop=False) st.download_button(label="Download Processed Audio", data=processed_audio, file_name="processed_audio.wav", mime="audio/wav") st.markdown("---") st.header("Examples") example_columns = st.columns(4) example_titles = ["Original Audio", "Separated Audio", "AudioLDM2", "StableAudio"] for col, title in zip(example_columns, example_titles): col.subheader(title) for p in exmples_prompts: with st.container(): st.write(f"Prompt: {p}") audio_columns = st.columns(4) for col in audio_columns: col.audio("goodres.wav", format="audio/mpeg", loop=False) st.markdown("