Spaces:
Sleeping
Sleeping
Upload 2 files
Browse files- app.py +2 -0
- requirements.txt +5 -2
app.py
CHANGED
|
@@ -9,6 +9,7 @@ import os
|
|
| 9 |
import traceback
|
| 10 |
import gc
|
| 11 |
import torch
|
|
|
|
| 12 |
|
| 13 |
# Import your modules
|
| 14 |
from engine import compute_mapss_measures
|
|
@@ -16,6 +17,7 @@ from models import get_model_config, cleanup_all_models
|
|
| 16 |
from config import DEFAULT_ALPHA
|
| 17 |
from utils import clear_gpu_memory
|
| 18 |
|
|
|
|
| 19 |
def process_audio_files(zip_file, model_name, layer, alpha):
|
| 20 |
"""
|
| 21 |
Process uploaded ZIP file containing audio mixtures.
|
|
|
|
| 9 |
import traceback
|
| 10 |
import gc
|
| 11 |
import torch
|
| 12 |
+
import spaces # Import spaces for ZeroGPU
|
| 13 |
|
| 14 |
# Import your modules
|
| 15 |
from engine import compute_mapss_measures
|
|
|
|
| 17 |
from config import DEFAULT_ALPHA
|
| 18 |
from utils import clear_gpu_memory
|
| 19 |
|
| 20 |
+
@spaces.GPU(duration=300) # Request GPU for up to 5 minutes
|
| 21 |
def process_audio_files(zip_file, model_name, layer, alpha):
|
| 22 |
"""
|
| 23 |
Process uploaded ZIP file containing audio mixtures.
|
requirements.txt
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
| 1 |
# Core dependencies
|
| 2 |
gradio>=4.0.0
|
| 3 |
torch>=2.0.0
|
|
@@ -19,8 +22,8 @@ pandas>=2.0.0
|
|
| 19 |
safetensors>=0.4.0
|
| 20 |
sentencepiece>=0.1.99 # For some tokenizers
|
| 21 |
|
| 22 |
-
# Optional optimizations
|
| 23 |
-
triton>=2.1.0 # For faster attention if available
|
| 24 |
|
| 25 |
# Memory management
|
| 26 |
psutil>=5.9.0
|
|
|
|
| 1 |
+
# ZeroGPU specific
|
| 2 |
+
spaces>=0.19.0
|
| 3 |
+
|
| 4 |
# Core dependencies
|
| 5 |
gradio>=4.0.0
|
| 6 |
torch>=2.0.0
|
|
|
|
| 22 |
safetensors>=0.4.0
|
| 23 |
sentencepiece>=0.1.99 # For some tokenizers
|
| 24 |
|
| 25 |
+
# Optional optimizations (comment out if causing issues)
|
| 26 |
+
# triton>=2.1.0 # For faster attention if available
|
| 27 |
|
| 28 |
# Memory management
|
| 29 |
psutil>=5.9.0
|