Feature Extraction
Transformers
Safetensors
PyTorch
reve
eeg
neuroscience
foundation-model
custom_code
Eval Results (legacy)
Run this model with HF Jobs
Run brain-bzh/reve-base on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/brain-bzh/reve-base. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/brain-bzh/reve-base on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use brain-bzh/reve-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use brain-bzh/reve-base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="brain-bzh/reve-base", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("brain-bzh/reve-base", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Fix bug with empty slice if amount of dimensions matches amount of frequencies, but is not equal to 512
#1
by isemenkov - opened
228 unmodified lines22923023123223323412 unmodified lines247248249250251252253254255228 unmodified linesself.freqs = freqsself.increment_time = increment_timeself.margin = margindef forward(self, positions_):positions = positions_.clone()12 unmodified linesp_w = 2 * math.pi * freqs_w / widthpositions = positions[..., None, None, None, None, :]loc = (positions[..., 0] * p_x + positions[..., 1] * p_y + positions[..., 2] * p_z + positions[..., 3] * p_w).view(*U, -1)if self.dimension != 512: # noqa_, _, hd = loc.shapediff = hd - self.dimension // 2loc = loc[:, :, :-diff]emb = torch.cat([torch.cos(loc), torch.sin(loc)], dim=-1)return emb228 unmodified lines22923023123223323423523623723823924024124224324424524624712 unmodified lines260261262263264265266267268269270271272273274275276277228 unmodified linesself.freqs = freqsself.increment_time = increment_timeself.margin = marginharmonics_size = 2 * self.freqs ** 4if self.dimension % 2 != 0:raise ValueError("Requested embedding size must be even. " \f"Requested: {self.dimension}, Must be even as amount of frequency components in positional encodings " \"is always even due to amount of harmonics being doubled (one for sine and one for cosine component).")if self.dimension > harmonics_size:raise ValueError(f"Requested embedding size is larger than the maximum possible size for the given frequency range. " \f"Requested: {self.dimension}, Maximum: {harmonics_size}. " \"Please increase the number of frequencies or decrease the embedding size.")def forward(self, positions_):positions = positions_.clone()12 unmodified linesp_w = 2 * math.pi * freqs_w / widthpositions = positions[..., None, None, None, None, :]loc = (positions[..., 0] * p_x + positions[..., 1] * p_y + positions[..., 2] * p_z + positions[..., 3] * p_w).view(*U, -1)# Positional encoding returns dimension of size self.freqs ** 4 per sine/cosine pair# That makes output dimention 2 * self.freqs ** 4# If requested embedding size of a model is larger final harmonics are cut off_, _, hd = loc.shapediff = hd - self.dimension // 2if diff < 0:raise ValueError("Requested embedding size is larger than the maximum possible size for the given frequency range. " \f"Requested: {self.dimension}, Maximum: {2 * self.freqs ** 4}. " \"Please increase the number of frequencies or decrease the embedding size.")elif diff > 0:loc = loc[:, :, :-diff]emb = torch.cat([torch.cos(loc), torch.sin(loc)], dim=-1)return emb
modeling_reve.py+25-3