Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/livekit/wakeword/data/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def extract_features_from_directory(
return np.stack(all_features, axis=0) # (N_clips, 16, 96)


def run_extraction(config: WakeWordConfig, sess_options: SessionOptions) -> None:
def run_extraction(config: WakeWordConfig, sess_options: SessionOptions | None = None) -> None:
"""Extract and save features for all splits of a wake word config."""
mel_frontend = MelSpectrogramFrontend(
onnx_path=get_mel_model_path(),
Expand Down
11 changes: 11 additions & 0 deletions tests/test_feature_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,14 @@ def test_nonexistent_onnx_raises(self, tmp_path):
"""Non-existent ONNX path should raise FileNotFoundError."""
with pytest.raises(FileNotFoundError):
MelSpectrogramFrontend(onnx_path=tmp_path / "nonexistent.onnx")


class TestRunExtraction:
"""Test the run_extraction entry point used by the CLI."""

def test_callable_without_sess_options(self, sample_config):
# The `augment` and `run` CLI commands call run_extraction(config) with no
# sess_options; this must not raise TypeError.
from livekit.wakeword.data.features import run_extraction

run_extraction(sample_config)
Loading