harp-dev commited on
Commit
aaf38d9
·
verified ·
1 Parent(s): a0d7d1d

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 +19 -18
  3. requirements.txt +2 -2
README.md CHANGED
@@ -4,7 +4,7 @@ emoji: ⚖️
4
  colorFrom: gray
5
  colorTo: indigo
6
  sdk: gradio
7
- sdk_version: 5.28.0
8
  app_file: app.py
9
  pinned: false
10
  license: gpl-3.0
 
4
  colorFrom: gray
5
  colorTo: indigo
6
  sdk: gradio
7
+ sdk_version: 6.24.0
8
  app_file: app.py
9
  pinned: false
10
  license: gpl-3.0
app.py CHANGED
@@ -29,7 +29,7 @@ model_card = ModelCard(
29
  name="Matchering",
30
  description="Match the RMS, Frequency Response, Peak Amplitude, and Stereo Width of a target track to a reference track for instant mastering.",
31
  author="sergree",
32
- tags=["audio", "mastering", "dsp", "matching"],
33
  )
34
 
35
 
@@ -52,20 +52,21 @@ def process_fn(target_audio, ref_audio, bit_depth):
52
  return out_path
53
 
54
 
55
- with gr.Blocks() as demo:
56
- input_components = [
57
- gr.Audio(type="filepath", label="Target Audio").harp_required(True).set_info("The track you want to master (your mix)."),
58
- gr.Audio(type="filepath", label="Reference Audio").harp_required(True).set_info("The reference track you want your target to sound like."),
59
- gr.Dropdown(choices=["pcm16", "pcm24"], value="pcm16", label="Output Bit Depth", info="Choose 16-bit PCM (CD quality) or 24-bit PCM (Studio quality) for the output file."),
60
- ]
61
- output_components = [
62
- gr.Audio(type="filepath", label="Mastered Audio"),
63
- ]
64
- build_endpoint(
65
- model_card=model_card,
66
- input_components=input_components,
67
- output_components=output_components,
68
- process_fn=process_fn,
69
- )
70
-
71
- demo.queue().launch(share=True, show_error=False, pwa=True)
 
 
29
  name="Matchering",
30
  description="Match the RMS, Frequency Response, Peak Amplitude, and Stereo Width of a target track to a reference track for instant mastering.",
31
  author="sergree",
32
+ tags=[Subcategory.POST_PROCESSING, 'audio', 'mastering', 'dsp', 'matching'],
33
  )
34
 
35
 
 
52
  return out_path
53
 
54
 
55
+ if __name__ == "__main__":
56
+ with gr.Blocks() as demo:
57
+ input_components = [
58
+ gr.Audio(type="filepath", label="Target Audio").harp_required(True).set_info("The track you want to master (your mix)."),
59
+ gr.Audio(type="filepath", label="Reference Audio").harp_required(True).set_info("The reference track you want your target to sound like."),
60
+ gr.Dropdown(choices=["pcm16", "pcm24"], value="pcm16", label="Output Bit Depth", info="Choose 16-bit PCM (CD quality) or 24-bit PCM (Studio quality) for the output file."),
61
+ ]
62
+ output_components = [
63
+ gr.Audio(type="filepath", label="Mastered Audio"),
64
+ ]
65
+ build_endpoint(
66
+ model_card=model_card,
67
+ input_components=input_components,
68
+ output_components=output_components,
69
+ process_fn=process_fn,
70
+ )
71
+
72
+ demo.queue().launch(share=True, show_error=True, pwa=True)
requirements.txt CHANGED
@@ -1,8 +1,8 @@
1
- git+https://github.com/TEAMuP-dev/pyharp.git@v0.3.0
2
- gradio>=4.0
3
  git+https://github.com/sergree/matchering.git@master
4
  numpy>=1.23.4
5
  scipy>=1.9.2
6
  soundfile>=0.11.0
7
  resampy>=0.4.2
8
  statsmodels>=0.13.2
 
 
1
+ git+https://github.com/TEAMuP-dev/pyharp.git@v0.4.0
 
2
  git+https://github.com/sergree/matchering.git@master
3
  numpy>=1.23.4
4
  scipy>=1.9.2
5
  soundfile>=0.11.0
6
  resampy>=0.4.2
7
  statsmodels>=0.13.2
8
+ spaces>=0.51.1