Run this model with HF Jobs
Run HuggingFaceTB/SmolVLM-500M-Instruct 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 and TRL to fine-tune https://huggingface.co/HuggingFaceTB/SmolVLM-500M-Instruct. 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/HuggingFaceTB/SmolVLM-500M-Instruct 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.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/HuggingFaceTB/SmolVLM-500M-Instruct. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Instructions to use HuggingFaceTB/SmolVLM-500M-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use HuggingFaceTB/SmolVLM-500M-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="HuggingFaceTB/SmolVLM-500M-Instruct") 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 AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("HuggingFaceTB/SmolVLM-500M-Instruct") model = AutoModelForMultimodalLM.from_pretrained("HuggingFaceTB/SmolVLM-500M-Instruct", 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 = processor.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(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use HuggingFaceTB/SmolVLM-500M-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "HuggingFaceTB/SmolVLM-500M-Instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "HuggingFaceTB/SmolVLM-500M-Instruct", "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/HuggingFaceTB/SmolVLM-500M-Instruct
- SGLang
How to use HuggingFaceTB/SmolVLM-500M-Instruct 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 "HuggingFaceTB/SmolVLM-500M-Instruct" \ --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": "HuggingFaceTB/SmolVLM-500M-Instruct", "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 "HuggingFaceTB/SmolVLM-500M-Instruct" \ --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": "HuggingFaceTB/SmolVLM-500M-Instruct", "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 HuggingFaceTB/SmolVLM-500M-Instruct with Docker Model Runner:
docker model run hf.co/HuggingFaceTB/SmolVLM-500M-Instruct
Upload ONNX weights
Browse filesFiles changed (24)
- onnx/decoder_model_merged.onnxAdded+3
- onnx/decoder_model_merged_bnb4.onnxAdded+3
- onnx/decoder_model_merged_fp16.onnxAdded+3
- onnx/decoder_model_merged_int8.onnxAdded+3
- onnx/decoder_model_merged_q4.onnxAdded+3
- onnx/decoder_model_merged_q4f16.onnxAdded+3
- onnx/decoder_model_merged_quantized.onnxAdded+3
- onnx/decoder_model_merged_uint8.onnxAdded+3
- onnx/embed_tokens.onnxAdded+3
- onnx/embed_tokens_bnb4.onnxAdded+3
- onnx/embed_tokens_fp16.onnxAdded+3
- onnx/embed_tokens_int8.onnxAdded+3
- onnx/embed_tokens_q4.onnxAdded+3
- onnx/embed_tokens_q4f16.onnxAdded+3
- onnx/embed_tokens_quantized.onnxAdded+3
- onnx/embed_tokens_uint8.onnxAdded+3
- onnx/vision_encoder.onnxAdded+3
- onnx/vision_encoder_bnb4.onnxAdded+3
- onnx/vision_encoder_fp16.onnxAdded+3
- onnx/vision_encoder_int8.onnxAdded+3
- onnx/vision_encoder_q4.onnxAdded+3
- onnx/vision_encoder_q4f16.onnxAdded+3
- onnx/vision_encoder_quantized.onnxAdded+3
- onnx/vision_encoder_uint8.onnxAdded+3
123version https://git-lfs.github.com/spec/v1oid sha256:1d4dc5a8464c92cf151be233e23da809992e111f5596ba245fe1eca28e838b7bsize 1450425745123version https://git-lfs.github.com/spec/v1oid sha256:c3b311d0d34a7c067485ad9d440045c892a73885c7db52f13336b428d5c302e3size 206503276123version https://git-lfs.github.com/spec/v1oid sha256:1dc67f9d505c4f0a1a9de1626537aa2fd440fbb16b6a74abfddf66169e1e486esize 725489060123version https://git-lfs.github.com/spec/v1oid sha256:36f53411b56c21868b0cf3d1fa0c1a7395ab88bcd1f7ae677bf91c54ab09cca0size 365038968123version https://git-lfs.github.com/spec/v1oid sha256:6d64c0fdce1c3515c40a08ff8e398bfbc0b2e961ae46d1b84b91e6a7b269b9d1size 229119140123version https://git-lfs.github.com/spec/v1oid sha256:289540c10892e905107f2a6f07a21d71df1aa3d73e0d3432d793df2ad80850e3size 205328183123version https://git-lfs.github.com/spec/v1oid sha256:69f48213b59637eee88e2b1af3c6bb23677fce77774a7237e8c1516c6b78ce47size 365039089123version https://git-lfs.github.com/spec/v1oid sha256:69f48213b59637eee88e2b1af3c6bb23677fce77774a7237e8c1516c6b78ce47size 365039089123version https://git-lfs.github.com/spec/v1oid sha256:6fe00a73de387cbe52cdb78f1b7c8bcda6bcb9974e40dc1b143315fc9f7e79afsize 189235499123version https://git-lfs.github.com/spec/v1oid sha256:19f4fad7cb17c6dad11b4520d2abcba173fc91f755d71907d31d11a9e5761606size 189235518123version https://git-lfs.github.com/spec/v1oid sha256:6b5f8cb6f78f90182bb60a3df22e9c47c93dc771d8d8172cce1f653f8da8a746size 94617986123version https://git-lfs.github.com/spec/v1oid sha256:f5f14887bf9b756d9fff2e412d474f0b5403e91f33b23460c9411f0ca54d945bsize 47309344123version https://git-lfs.github.com/spec/v1oid sha256:19f4fad7cb17c6dad11b4520d2abcba173fc91f755d71907d31d11a9e5761606size 189235518123version https://git-lfs.github.com/spec/v1oid sha256:76c3b8232c463118190d1c711f2a7bff00a72f2077b9b19998f3a2c6344eb035size 94618005123version https://git-lfs.github.com/spec/v1oid sha256:f5f14887bf9b756d9fff2e412d474f0b5403e91f33b23460c9411f0ca54d945bsize 47309344123version https://git-lfs.github.com/spec/v1oid sha256:f5f14887bf9b756d9fff2e412d474f0b5403e91f33b23460c9411f0ca54d945bsize 47309344123version https://git-lfs.github.com/spec/v1oid sha256:7ecd87031065252c5e3419f9a75db938a92cd5d55d2c22024d8815efd980104fsize 393190865123version https://git-lfs.github.com/spec/v1oid sha256:e4af9028ddd3357b50a4d823987bb81bf2aca83eeba425bfc02aaa339eeca9f4size 60688947123version https://git-lfs.github.com/spec/v1oid sha256:b2fca5aecb5fe29549ce0a1cc3091f64f7f33dafb5f5f215e2b774b5cf1eeec3size 196731877123version https://git-lfs.github.com/spec/v1oid sha256:50b814aa048a996bf5d5128a16c19046371a9a1aae24b930672f550af6c43646size 98966519123version https://git-lfs.github.com/spec/v1oid sha256:179812d5b1315edbe3e7164ea3d847c52723692e83ac9c770a5234962663fcadsize 66734107123version https://git-lfs.github.com/spec/v1oid sha256:d5f3df9fd7113e564b1e167de20750572d25fd75c822365f496ff467bc9e7457size 57691792123version https://git-lfs.github.com/spec/v1oid sha256:0612873758c96d759910a45dddbd150ea26d40cffb1ae49f391ea39dcbf50c09size 98966563123version https://git-lfs.github.com/spec/v1oid sha256:0612873758c96d759910a45dddbd150ea26d40cffb1ae49f391ea39dcbf50c09size 98966563onnx/decoder_model_merged.onnxAdded+3
onnx/decoder_model_merged_bnb4.onnxAdded+3
onnx/decoder_model_merged_fp16.onnxAdded+3
onnx/decoder_model_merged_int8.onnxAdded+3
onnx/decoder_model_merged_q4.onnxAdded+3
onnx/decoder_model_merged_q4f16.onnxAdded+3
onnx/decoder_model_merged_quantized.onnxAdded+3
onnx/decoder_model_merged_uint8.onnxAdded+3
onnx/embed_tokens.onnxAdded+3
onnx/embed_tokens_bnb4.onnxAdded+3
onnx/embed_tokens_fp16.onnxAdded+3
onnx/embed_tokens_int8.onnxAdded+3
onnx/embed_tokens_q4.onnxAdded+3
onnx/embed_tokens_q4f16.onnxAdded+3
onnx/embed_tokens_quantized.onnxAdded+3
onnx/embed_tokens_uint8.onnxAdded+3
onnx/vision_encoder.onnxAdded+3
onnx/vision_encoder_bnb4.onnxAdded+3
onnx/vision_encoder_fp16.onnxAdded+3
onnx/vision_encoder_int8.onnxAdded+3
onnx/vision_encoder_q4.onnxAdded+3
onnx/vision_encoder_q4f16.onnxAdded+3
onnx/vision_encoder_quantized.onnxAdded+3
onnx/vision_encoder_uint8.onnxAdded+3