Upload nanoVLM using push_to_hub
Browse filesFiles changed (3)
- README.mdAdded+27
- config.jsonAdded+32
- model.safetensorsAdded+3
123456789101112131415161718192021222324252627
---# For reference on model card metadata, see the spec: https://github.com/huggingface/hub-docs/blob/main/modelcard.md?plain=1# Doc / guide: https://huggingface.co/docs/hub/model-cardslibrary_name: nanovlmlicense: mitpipeline_tag: image-text-to-texttags: - vision-language - multimodal - research---
**nanoVLM** is a minimal and lightweight Vision-Language Model (VLM) designed for efficient training and experimentation. Built using pure PyTorch, the entire model architecture and training logic fits within ~750 lines of code. It combines a ViT-based image encoder (SigLIP-B/16-224-85M) with a lightweight causal language model (SmolLM2-135M), resulting in a compact 222M parameter model.
For more information, check out the base model on https://huggingface.co/lusxvr/nanoVLM-222M.
**Usage:**
Clone the nanoVLM repository: https://github.com/huggingface/nanoVLM.Follow the install instructions and run the following code:
```pythonfrom models.vision_language_model import VisionLanguageModel
model = VisionLanguageModel.from_pretrained("lewiswatson/nanoVLM")```1234567891011121314151617181920212223242526272829303132{ "vit_hidden_dim": 768, "vit_inter_dim": 3072, "vit_patch_size": 16, "vit_img_size": 224, "vit_n_heads": 12, "vit_dropout": 0.0, "vit_n_blocks": 12, "vit_ln_eps": 1e-06, "vit_cls_flag": false, "vit_model_type": "google/siglip-base-patch16-224", "lm_hidden_dim": 576, "lm_inter_dim": 1536, "lm_rms_eps": 1e-05, "lm_re_base": 100000, "lm_max_position_embeddings": 8192, "lm_vocab_size": 49152, "lm_n_heads": 9, "lm_n_kv_heads": 3, "lm_dropout": 0.0, "lm_n_blocks": 30, "lm_attn_scaling": 1.0, "lm_eos_token_id": 0, "lm_max_length": 79, "lm_use_tokens": false, "lm_tie_weights": true, "lm_model_type": "HuggingFaceTB/SmolLM2-135M", "lm_tokenizer": "HuggingFaceTB/cosmo2-tokenizer", "mp_pixel_shuffle_factor": 2, "vlm_load_backbone_weights": true, "vlm_checkpoint_path": "checkpoints/nanoVLM-222M"}123version https://git-lfs.github.com/spec/v1oid sha256:ae91885212cbf2d3b6c753dd5c248088b3f4313479339fc4fd76e1ee86eedf0bsize 888372464README.mdAdded+27
config.jsonAdded+32
model.safetensorsAdded+3