arhanv commited on
Commit
692627b
·
1 Parent(s): 00fa560

updated readme and loading screens

Browse files
Files changed (2) hide show
  1. README.md +5 -0
  2. app.py +4 -1
README.md CHANGED
@@ -11,3 +11,8 @@ short_description: generating drum kits using descriptive queries with CLAP
11
  ---
12
 
13
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
11
  ---
12
 
13
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
14
+
15
+ To run this demo locally, follow these steps:
16
+ 1. Clone the repository to your machine: `git clone https://huggingface.co/spaces/arhanv/drum-kit-generator`
17
+ 2. Install the dependencies with `pip install -r requirements.txt`
18
+ 3. Run the streamlit app with `streamlit run app.py`
app.py CHANGED
@@ -11,6 +11,7 @@ st.title("semantic spaces: kit generator")
11
  st.subheader("generate drum kits and audio effects with text prompts")
12
  st.write("uses publicly available samples from [freesound](https://zenodo.org/records/4687854) and [CLAP embeddings](https://github.com/LAION-AI/CLAP) for text-based querying")
13
  st.write("hint: turn audio effects on! try weird prompts!")
 
14
 
15
  with st.container(border=True):
16
  # User Inputs
@@ -25,12 +26,14 @@ with st.container(border=True):
25
 
26
  # Run the inference
27
  if st.button("Generate Drum Kit"):
 
28
  start_drum_time = time.time()
29
  drum_kit = generate_drum_kit(prompt, kit_size)
30
  drum_time = time.time() - start_drum_time
31
  st.session_state["dry_kit"] = drum_kit
32
- st.write(f"Drum kit generated in {drum_time} seconds.")
33
  if use_fx:
 
34
  start_fx_time = time.time()
35
  drum_kit, fx_params, pre_fx_fitness, post_fx_fitness = get_fx(drum_kit, fx_prompt)
36
  fx_time = time.time() - start_fx_time
 
11
  st.subheader("generate drum kits and audio effects with text prompts")
12
  st.write("uses publicly available samples from [freesound](https://zenodo.org/records/4687854) and [CLAP embeddings](https://github.com/LAION-AI/CLAP) for text-based querying")
13
  st.write("hint: turn audio effects on! try weird prompts!")
14
+ st.write("(works best on desktop, audio effects should take 20s-1min to generate)")
15
 
16
  with st.container(border=True):
17
  # User Inputs
 
26
 
27
  # Run the inference
28
  if st.button("Generate Drum Kit"):
29
+ st.write("Finding the best samples...")
30
  start_drum_time = time.time()
31
  drum_kit = generate_drum_kit(prompt, kit_size)
32
  drum_time = time.time() - start_drum_time
33
  st.session_state["dry_kit"] = drum_kit
34
+ st.write(f"Drum Kit generated in {drum_time} seconds.")
35
  if use_fx:
36
+ st.write("Generating audio effects... (takes up to 1 min)")
37
  start_fx_time = time.time()
38
  drum_kit, fx_params, pre_fx_fitness, post_fx_fitness = get_fx(drum_kit, fx_prompt)
39
  fx_time = time.time() - start_fx_time