Instructions to use gatilin/north-micro-vision-encoder with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use gatilin/north-micro-vision-encoder with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="gatilin/north-micro-vision-encoder")# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("gatilin/north-micro-vision-encoder") model = AutoModelForMultimodalLM.from_pretrained("gatilin/north-micro-vision-encoder", device_map="auto") - Notebooks
- Google Colab
- Kaggle
North Micro Vision: visual tower and deepstack mergers
Community extraction of all model.visual.* tensors from CohereLabs/North-Micro-Vision-Instruct, revision fa548d9aa62c1220bfd21fc6cfc465f1bd2a1a40. It includes the vision tower, final merger, and three deepstack mergers; the language model is not included. Original tensor keys, shapes and dtypes are retained. See tensor_mapping.json, extraction.json and validation.json for source byte checks and measured validation.
Loading
Requires PyTorch, torchvision, accelerate, safetensors, Pillow and Transformers 5.21.1 (the verified runtime). For other versions, verify that CohereCompassVisionModel and its processor are compatible.
import sys, torch
from PIL import Image
from huggingface_hub import snapshot_download
root = snapshot_download('gatilin/north-micro-vision-encoder')
sys.path.insert(0, root)
from component import load_model, load_processor
model = load_model(root)
processor = load_processor(root)
inputs = processor(images=Image.open('image.jpg').convert('RGB'), return_tensors='pt')
inputs['pixel_values'] = inputs['pixel_values'].to(next(model.parameters()).dtype)
with torch.inference_mode():
result = model(hidden_states=inputs['pixel_values'], grid_thw=inputs['image_grid_thw'])
print(result.last_hidden_state.shape, result.pooler_output.shape)
The output includes the unmerged visual tokens, final merged features and intermediate deepstack features. The component alone is not a complete vision-language model.
License and verification
The source model is released under Apache 2.0. The original source model card is available at the link above. The local CPU test in validation.json is a smoke test; it does not establish parity with the complete source VLM or GPU inference.
- Downloads last month
- 19
Model tree for gatilin/north-micro-vision-encoder
Base model
CohereLabs/North-Micro-Vision-Instruct