harp-dev commited on
Commit
b85bf77
·
verified ·
1 Parent(s): 17e7be1

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 +2 -2
  2. app.py +20 -19
  3. requirements.txt +2 -2
README.md CHANGED
@@ -1,10 +1,10 @@
1
  ---
2
- title: FST AI Music Detection
3
  emoji: 🕵️
4
  colorFrom: yellow
5
  colorTo: blue
6
  sdk: gradio
7
- sdk_version: 5.28.0
8
  python_version: '3.11'
9
  app_file: app.py
10
  pinned: false
 
1
  ---
2
+ title: Fusion Segment Transformer
3
  emoji: 🕵️
4
  colorFrom: yellow
5
  colorTo: blue
6
  sdk: gradio
7
+ sdk_version: 6.24.0
8
  python_version: '3.11'
9
  app_file: app.py
10
  pinned: false
app.py CHANGED
@@ -83,6 +83,7 @@ from pathlib import Path
83
 
84
  from huggingface_hub import hf_hub_download
85
  from pyharp import ModelCard, build_endpoint
 
86
 
87
  from inference import inference
88
 
@@ -119,7 +120,7 @@ model_card = ModelCard(
119
  "structural, downbeat-segmented view of the track. Submitted to ICASSP 2026."
120
  ),
121
  author="Yumin Kim, Seonghyeon Go",
122
- tags=["music", "classification", "ai-detection"],
123
  )
124
 
125
 
@@ -144,22 +145,22 @@ def process_fn(audio_path: str) -> str:
144
  return out_path
145
 
146
 
147
- with gr.Blocks() as demo:
148
- input_components = [
149
- gr.Audio(type="filepath", label="Input Audio").harp_required(True),
150
- ]
151
- output_components = [
152
- gr.File(type="filepath", label="Detection Result", file_types=[".txt"]).set_info(
153
- "Prediction (Real/Fake) and confidence, as a text file."
154
- ),
155
- ]
156
-
157
- build_endpoint(
158
- model_card=model_card,
159
- input_components=input_components,
160
- output_components=output_components,
161
- process_fn=process_fn,
162
- )
163
-
164
  if __name__ == "__main__":
165
- demo.queue().launch(pwa=True)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83
 
84
  from huggingface_hub import hf_hub_download
85
  from pyharp import ModelCard, build_endpoint
86
+ from pyharp.tags import Subcategory
87
 
88
  from inference import inference
89
 
 
120
  "structural, downbeat-segmented view of the track. Submitted to ICASSP 2026."
121
  ),
122
  author="Yumin Kim, Seonghyeon Go",
123
+ tags=[Subcategory.MUSIC_ANALYSIS, 'music', 'classification', 'ai-detection'],
124
  )
125
 
126
 
 
145
  return out_path
146
 
147
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
148
  if __name__ == "__main__":
149
+ with gr.Blocks() as demo:
150
+ input_components = [
151
+ gr.Audio(type="filepath", label="Input Audio").harp_required(True),
152
+ ]
153
+ output_components = [
154
+ gr.File(type="filepath", label="Detection Result", file_types=[".txt"]).set_info(
155
+ "Prediction (Real/Fake) and confidence, as a text file."
156
+ ),
157
+ ]
158
+
159
+ build_endpoint(
160
+ model_card=model_card,
161
+ input_components=input_components,
162
+ output_components=output_components,
163
+ process_fn=process_fn,
164
+ )
165
+
166
+ demo.queue().launch(show_error=True, share=True, pwa=True)
requirements.txt CHANGED
@@ -1,10 +1,10 @@
1
- git+https://github.com/TEAMuP-dev/pyharp.git@develop
2
  https://github.com/CPJKU/beat_this/archive/main.zip
3
  torch==2.8.0
4
  torchaudio==2.8.0
5
  pytorch-lightning>=2.0.0
6
  transformers>=4.46.0
7
- huggingface_hub>=0.25.0,<1.0.0
8
  librosa>=0.10.0
9
  numpy>=1.24.0
10
  scipy>=1.10.0
 
1
+ git+https://github.com/TEAMuP-dev/pyharp.git@v0.4.0
2
  https://github.com/CPJKU/beat_this/archive/main.zip
3
  torch==2.8.0
4
  torchaudio==2.8.0
5
  pytorch-lightning>=2.0.0
6
  transformers>=4.46.0
7
+ huggingface_hub
8
  librosa>=0.10.0
9
  numpy>=1.24.0
10
  scipy>=1.10.0