Instructions to use epfl-neuroai/topo-omni with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use epfl-neuroai/topo-omni with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="epfl-neuroai/topo-omni") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("epfl-neuroai/topo-omni") model = AutoModelForMultimodalLM.from_pretrained("epfl-neuroai/topo-omni", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use epfl-neuroai/topo-omni with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "epfl-neuroai/topo-omni" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "epfl-neuroai/topo-omni", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/epfl-neuroai/topo-omni
- SGLang
How to use epfl-neuroai/topo-omni with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "epfl-neuroai/topo-omni" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "epfl-neuroai/topo-omni", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "epfl-neuroai/topo-omni" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "epfl-neuroai/topo-omni", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use epfl-neuroai/topo-omni with Docker Model Runner:
docker model run hf.co/epfl-neuroai/topo-omni
Topo-Omni
Topo-Omni is Qwen2.5-Omni-3B fine-tuned with a spatial smoothness loss that induces a brain-like topographic organization across its vision, audio, and language layers. Every unit is assigned a fixed 2-D coordinate on a shared cortical sheet, and training encourages units close on the sheet to respond similarly.
⚠️ Required: set the sheet layout before importing
export TOPO_SHEET_LAYOUT=tiled32
Model Details
Base model: Qwen/Qwen2.5-Omni-3B (Thinker module)
Architecture:
Qwen2_5OmniThinkerForConditionalGenerationwith aCorticalAdaptorat each layer mapping hidden activations onto the sheet and back, via a learned near-identity linear map and its pseudo-inverseCortical sheet: 800 × 576 = 460,800 units = 100 × 4608
Band Tiling Extent Encoder (per modality) 32 tiles of 64 × 72 in an 8 × 4 grid 512 × 288 Thinker (language model) 36 tiles of 72 × 64 in a 4 × 9 grid 288 × 576 Modalities: text, image, video, and audio in; text out
Usage
import os
os.environ["TOPO_SHEET_LAYOUT"] = "tiled32" # must precede the imports below
from transformers import Qwen2_5OmniProcessor, Qwen2_5OmniThinkerConfig
from src.models.qwen2_5_omni import Qwen2_5OmniThinkerForConditionalGeneration
repo_id = "epfl-neuroai/topo-omni-v2"
config = Qwen2_5OmniThinkerConfig.from_pretrained(repo_id)
config.audio_config.is_training = False
config.vision_config.is_training = False
config.text_config.is_training = False
model = Qwen2_5OmniThinkerForConditionalGeneration.from_pretrained(
repo_id, dtype="auto", device_map="auto", config=config,
).eval()
processor = Qwen2_5OmniProcessor.from_pretrained(repo_id)
Or through the repository's single loader, which applies the same settings:
from src.core.model_loading import load_topo_omni
model, processor, config = load_topo_omni("epfl-neuroai/topo-omni-v2", device="cuda")
This is a custom architecture and will not load correctly through a stock transformers pipeline.
To inspect or intervene on the sheet directly (selectivity mapping, ablation, stimulation), see
src/experiments/.
Training
Fine-tuned from Qwen/Qwen2.5-Omni-3B with TRL's
SFTTrainer plus a spatial smoothness loss.
| Hyperparameter | Value |
|---|---|
| Epochs | 10 |
| Per-device batch size | 3 |
| Gradient accumulation | 5 |
| Learning rate | 5e-5 (cosine schedule, 3% warmup) |
| Weight decay | 0.01 |
| Precision | bf16 |
| Seed | 42 |
Spatial loss weight (alpha) |
20 |
| Spatial loss accumulation | mean |
| Cortical projection init | near-identity (scale 1e-3) |
| Audio chunk | 5 |
The spatial loss has two terms, both sampled per batch with depth-stratified centres:
| Term | Radius | Neighborhoods / batch | Max units | Weight |
|---|---|---|---|---|
| Fine | 5 (fixed) | 4000 | 768 | 1.0 |
| Coarse | 4 → 32 (linear) | 600 | 512 | 10.0 |
Framework versions
- TRL: 0.25.1
- Transformers: 4.57.6
- PyTorch: 2.9.1
- Datasets: 4.4.1
Evaluation
The cortical sheet learned by this model is evaluated for:
- Selectivity — ON-vs-OFF contrasts (faces, bodies, objects, scenes, speech, etc.) with FDR-corrected t-tests
- Spatial clustering — Island Moran's I spatial autocorrelation of selectivity maps
- Topographic maps — orientation preference, pinwheel density and column spacing, compared against macaque V1; retinotopy and tonotopy
- Brain alignment — correlation of model topography with human fMRI t-maps (NSD, SpaceTop)
- Causal relevance — ablation and stimulation of localizer-defined regions
See src/experiments/ and
the project README.
Citation
@article{alkhamissi-mehrer-topo-omni-2026,
doi = {10.48550/ARXIV.2606.09770},
url = {https://arxiv.org/abs/2606.09770},
author = {AlKhamissi, Badr and Mehrer, Johannes and Marinov, Lara and Abdelaal, Ahmed and Gokce, Abdulkadir and Schrimpf, Martin},
keywords = {Neurons and Cognition (q-bio.NC), Machine Learning (cs.LG), FOS: Biological sciences, FOS: Biological sciences, FOS: Computer and information sciences, FOS: Computer and information sciences},
title = {Discovering Functionally Selective Brain Regions with a Deep Topographic Multimodal Model},
publisher = {arXiv},
year = {2026},
copyright = {Creative Commons Attribution Share Alike 4.0 International}
}
Built on Qwen2.5-Omni and the topographic-DNN approaches introduced by TDANN and TopoLM.
License
Released under the same license as the base model, Qwen2.5-Omni-3B — Apache 2.0.
- Downloads last month
- 65
Model tree for epfl-neuroai/topo-omni
Base model
Qwen/Qwen2.5-Omni-3B