Feature Extraction
Transformers
Safetensors
spera
eeg
biosignal
time-series
foundation-model
self-supervised-learning
representation-learning
transformer
jepa
neuroscience
brain-computer-interface
neurips-2026
custom_code
Eval Results (legacy)
Instructions to use sees4321/SPERA_EEG with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sees4321/SPERA_EEG with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="sees4321/SPERA_EEG", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("sees4321/SPERA_EEG", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download configuration_spera.py from sees4321/SPERA_EEG: direct link, hf CLI and curl.
- Browser
- Download file 1.45 kB
-
https://huggingface.co/sees4321/SPERA_EEG/resolve/main/configuration_spera.py
- Command line
-
hf download hf://sees4321/SPERA_EEG/configuration_spera.py
-
curl -L -o configuration_spera.py https://huggingface.co/sees4321/SPERA_EEG/resolve/main/configuration_spera.py
1.45 kB
| """Optional Transformers configuration; native training uses EEGModelConfig.""" | |
| from __future__ import annotations | |
| from dataclasses import fields | |
| from transformers import PretrainedConfig | |
| from .config import EEGModelConfig | |
| class SperaConfig(PretrainedConfig): | |
| model_type = "spera" | |
| attribute_map = { | |
| "hidden_size": "d_model", | |
| "num_attention_heads": "n_heads", | |
| "num_hidden_layers": "n_layers", | |
| } | |
| def __init__(self, evaluation_preprocessing=None, **kwargs): | |
| for alias, name in self.attribute_map.items(): | |
| if alias in kwargs: | |
| value = kwargs.pop(alias) | |
| if name in kwargs and kwargs[name] != value: | |
| raise ValueError(f"Conflicting {alias} and {name}") | |
| kwargs[name] = value | |
| native = EEGModelConfig(**{ | |
| field.name: kwargs.pop(field.name) | |
| for field in fields(EEGModelConfig) if field.name in kwargs | |
| }) | |
| super().__init__(**kwargs) | |
| for name, value in native.to_dict().items(): | |
| setattr(self, name, value) | |
| # Metadata only: forward expects already-preprocessed EEG/coordinates. | |
| self.evaluation_preprocessing = evaluation_preprocessing | |
| def to_eeg_config(self): | |
| return EEGModelConfig(**{ | |
| field.name: getattr(self, field.name) for field in fields(EEGModelConfig) | |
| }) | |
| SperaConfig.register_for_auto_class("AutoConfig") | |