Spaces:
Sleeping
Sleeping
Commit ·
a0178bc
1
Parent(s): 383d37a
feat: integrate ZeroGPU spaces.GPU acceleration
Browse files- app.py +3 -0
- requirements.txt +1 -0
app.py
CHANGED
|
@@ -11,6 +11,7 @@ sys.path.insert(0, str(Path(__file__).parent))
|
|
| 11 |
import gradio as gr
|
| 12 |
import numpy as np
|
| 13 |
import soundfile as sf
|
|
|
|
| 14 |
from scipy import signal
|
| 15 |
|
| 16 |
from splitsafe.report import to_dict, to_text
|
|
@@ -33,6 +34,7 @@ def generate_sample_tone(freq: float, duration: float = 3.0, sr: int = 16000) ->
|
|
| 33 |
return x.astype(np.float32)
|
| 34 |
|
| 35 |
|
|
|
|
| 36 |
def audit_splits(train_files, test_files, speaker_regex, min_votes, strict_speakers):
|
| 37 |
"""Audit user-provided audio files across split boundaries."""
|
| 38 |
if not train_files or not test_files:
|
|
@@ -78,6 +80,7 @@ def audit_splits(train_files, test_files, speaker_regex, min_votes, strict_speak
|
|
| 78 |
return summary_md, text_report
|
| 79 |
|
| 80 |
|
|
|
|
| 81 |
def run_demo_benchmark():
|
| 82 |
"""Generates synthetic dataset on the fly to demonstrate leak detection."""
|
| 83 |
with tempfile.TemporaryDirectory() as tmpdir:
|
|
|
|
| 11 |
import gradio as gr
|
| 12 |
import numpy as np
|
| 13 |
import soundfile as sf
|
| 14 |
+
import spaces
|
| 15 |
from scipy import signal
|
| 16 |
|
| 17 |
from splitsafe.report import to_dict, to_text
|
|
|
|
| 34 |
return x.astype(np.float32)
|
| 35 |
|
| 36 |
|
| 37 |
+
@spaces.GPU
|
| 38 |
def audit_splits(train_files, test_files, speaker_regex, min_votes, strict_speakers):
|
| 39 |
"""Audit user-provided audio files across split boundaries."""
|
| 40 |
if not train_files or not test_files:
|
|
|
|
| 80 |
return summary_md, text_report
|
| 81 |
|
| 82 |
|
| 83 |
+
@spaces.GPU
|
| 84 |
def run_demo_benchmark():
|
| 85 |
"""Generates synthetic dataset on the fly to demonstrate leak detection."""
|
| 86 |
with tempfile.TemporaryDirectory() as tmpdir:
|
requirements.txt
CHANGED
|
@@ -2,3 +2,4 @@ gradio>=5.20.0
|
|
| 2 |
numpy>=1.24.0
|
| 3 |
scipy>=1.10.0
|
| 4 |
soundfile>=0.12.0
|
|
|
|
|
|
| 2 |
numpy>=1.24.0
|
| 3 |
scipy>=1.10.0
|
| 4 |
soundfile>=0.12.0
|
| 5 |
+
spaces
|