Spaces:
Running
Running
Nicholas Finch
fix: default workers=0 (sequential) for Docker cache — ProcessPoolExecutor hangs on cpu-basic
d7013e6 Download src/interfaces/i_audio.py from tisaconundrum/grassmann-cache: direct link, hf CLI and curl.
- Browser
- Download file 620 Bytes
-
https://huggingface.co/spaces/tisaconundrum/grassmann-cache/resolve/main/src/interfaces/i_audio.py
- Command line
-
hf download hf://spaces/tisaconundrum/grassmann-cache/src/interfaces/i_audio.py
-
curl -L -o i_audio.py https://huggingface.co/spaces/tisaconundrum/grassmann-cache/resolve/main/src/interfaces/i_audio.py
620 Bytes
| from abc import ABC, abstractmethod | |
| from typing import Any | |
| import torch | |
| class IAudioProcessor(ABC): | |
| """Interface for audio feature extraction.""" | |
| def load(self, path: str) -> torch.Tensor: | |
| """Load raw audio from file. Returns waveform tensor.""" | |
| ... | |
| def extract_features(self, waveform: torch.Tensor) -> torch.Tensor: | |
| """Extract features (e.g. mel spectrogram) from waveform.""" | |
| ... | |
| def normalize(self, features: torch.Tensor) -> torch.Tensor: | |
| """Normalize features for model input.""" | |
| ... | |