harp-dev commited on
Commit
245156a
·
verified ·
1 Parent(s): 1677c0e

Bring the Space up to the pyharp example standard (taxonomy tags, __main__ guard, show_error, v0.4.0)

Browse files
Files changed (3) hide show
  1. README.md +1 -1
  2. app.py +35 -34
  3. requirements.txt +2 -1
README.md CHANGED
@@ -4,7 +4,7 @@ emoji: ✂️
4
  colorFrom: pink
5
  colorTo: red
6
  sdk: gradio
7
- sdk_version: 5.28.0
8
  app_file: app.py
9
  pinned: false
10
  license: isc
 
4
  colorFrom: pink
5
  colorTo: red
6
  sdk: gradio
7
+ sdk_version: 6.24.0
8
  app_file: app.py
9
  pinned: false
10
  license: isc
app.py CHANGED
@@ -20,7 +20,7 @@ model_card = ModelCard(
20
  "Output: A single remixed audio file with adjustable harmonic & percussive balance, based on the selected parameters."
21
  ),
22
  author="Hugo Flores Garcia",
23
- tags=["example", "separator", "hpss"]
24
  )
25
 
26
 
@@ -111,36 +111,37 @@ output_labels = gr.JSON(label="Labels")
111
 
112
 
113
  # Launch the App
114
- with gr.Blocks() as demo:
115
- # Build endpoint inside Blocks context
116
- endpoint = build_endpoint(
117
- model_card=model_card,
118
- input_components=[
119
- input_audio,
120
- harmonic_slider,
121
- percussive_slider,
122
- kernel_slider,
123
- margin_slider
124
- ],
125
- output_components=[
126
- output_audio,
127
- output_labels
128
- ],
129
- process_fn=process_fn
130
- )
131
-
132
- # Layout
133
- endpoint["controls_button"]
134
- endpoint["controls_data"]
135
- input_audio.render()
136
- harmonic_slider.render()
137
- percussive_slider.render()
138
- kernel_slider.render()
139
- margin_slider.render()
140
- output_audio.render()
141
- output_labels.render()
142
- endpoint["process_button"]
143
- endpoint["cancel_button"]
144
-
145
- demo.queue()
146
- demo.launch(share=True, show_error=True)
 
 
20
  "Output: A single remixed audio file with adjustable harmonic & percussive balance, based on the selected parameters."
21
  ),
22
  author="Hugo Flores Garcia",
23
+ tags=[Subcategory.STEM_SEPARATION, 'example', 'separator', 'hpss']
24
  )
25
 
26
 
 
111
 
112
 
113
  # Launch the App
114
+ if __name__ == "__main__":
115
+ with gr.Blocks() as demo:
116
+ # Build endpoint inside Blocks context
117
+ endpoint = build_endpoint(
118
+ model_card=model_card,
119
+ input_components=[
120
+ input_audio,
121
+ harmonic_slider,
122
+ percussive_slider,
123
+ kernel_slider,
124
+ margin_slider
125
+ ],
126
+ output_components=[
127
+ output_audio,
128
+ output_labels
129
+ ],
130
+ process_fn=process_fn
131
+ )
132
+
133
+ # Layout
134
+ endpoint["controls_button"]
135
+ endpoint["controls_data"]
136
+ input_audio.render()
137
+ harmonic_slider.render()
138
+ percussive_slider.render()
139
+ kernel_slider.render()
140
+ margin_slider.render()
141
+ output_audio.render()
142
+ output_labels.render()
143
+ endpoint["process_button"]
144
+ endpoint["cancel_button"]
145
+
146
+ demo.queue()
147
+ demo.launch(pwa=True, share=True, show_error=True)
requirements.txt CHANGED
@@ -1,5 +1,5 @@
1
  # PyHARP from correct branch
2
- git+https://github.com/lindseydeng/pyharp.git@main
3
 
4
  # Descript audiotools
5
  git+https://github.com/descriptinc/audiotools.git
@@ -7,3 +7,4 @@ git+https://github.com/descriptinc/audiotools.git
7
  torch
8
  torchaudio
9
  librosa
 
 
1
  # PyHARP from correct branch
2
+ git+https://github.com/TEAMuP-dev/pyharp.git@v0.4.0
3
 
4
  # Descript audiotools
5
  git+https://github.com/descriptinc/audiotools.git
 
7
  torch
8
  torchaudio
9
  librosa
10
+ spaces>=0.51.1