Spaces:
Sleeping
Sleeping
Download src/preprocessing/chunker.py from koushik2109/mindscope-Model: direct link, hf CLI and curl.
- Browser
- Download file 245 Bytes
-
https://huggingface.co/spaces/koushik2109/mindscope-Model/resolve/main/src/preprocessing/chunker.py
- Command line
-
hf download hf://spaces/koushik2109/mindscope-Model/src/preprocessing/chunker.py
-
curl -L -o chunker.py https://huggingface.co/spaces/koushik2109/mindscope-Model/resolve/main/src/preprocessing/chunker.py
245 Bytes
| from typing import Sequence | |
| import numpy as np | |
| def sliding_window(array: np.ndarray, window_size: int, step_size: int) -> Sequence[np.ndarray]: | |
| return [array[i : i + window_size] for i in range(0, len(array) - window_size + 1, step_size)] | |