Run this model with HF Jobs
Run trl-internal-testing/tiny-SmolVLMForConditionalGeneration 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/trl-internal-testing/tiny-SmolVLMForConditionalGeneration. 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/trl-internal-testing/tiny-SmolVLMForConditionalGeneration 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/trl-internal-testing/tiny-SmolVLMForConditionalGeneration. 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.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/trl-internal-testing/tiny-SmolVLMForConditionalGeneration. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use trl-internal-testing/tiny-SmolVLMForConditionalGeneration with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use trl-internal-testing/tiny-SmolVLMForConditionalGeneration with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="trl-internal-testing/tiny-SmolVLMForConditionalGeneration") 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("trl-internal-testing/tiny-SmolVLMForConditionalGeneration") model = AutoModelForMultimodalLM.from_pretrained("trl-internal-testing/tiny-SmolVLMForConditionalGeneration", 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 trl-internal-testing/tiny-SmolVLMForConditionalGeneration with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "trl-internal-testing/tiny-SmolVLMForConditionalGeneration" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "trl-internal-testing/tiny-SmolVLMForConditionalGeneration", "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/trl-internal-testing/tiny-SmolVLMForConditionalGeneration
- SGLang
How to use trl-internal-testing/tiny-SmolVLMForConditionalGeneration 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 "trl-internal-testing/tiny-SmolVLMForConditionalGeneration" \ --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": "trl-internal-testing/tiny-SmolVLMForConditionalGeneration", "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 "trl-internal-testing/tiny-SmolVLMForConditionalGeneration" \ --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": "trl-internal-testing/tiny-SmolVLMForConditionalGeneration", "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 trl-internal-testing/tiny-SmolVLMForConditionalGeneration with Docker Model Runner:
docker model run hf.co/trl-internal-testing/tiny-SmolVLMForConditionalGeneration
Upload SmolVLMForConditionalGeneration
Browse filesFiles changed (6)
12<|im_start|>{% for message in messages %}{{message['role'] | capitalize}}{% if message['content'][0]['type'] == 'image' %}{{':'}}{% else %}{{': '}}{% endif %}{% for line in message['content'] %}{% if line['type'] == 'text' %}{{line['text']}}{% elif line['type'] == 'image' %}{{ '<image>' }}{% endif %}{% endfor %}<end_of_utterance>{% endfor %}{% if add_generation_prompt %}{{ 'Assistant:' }}{% endif %}12<|im_start|>{% for message in messages %}{{message['role'] | capitalize}}{% if message['content'] is string %}{{': ' + message['content']}}{% else %}{% if message['content'][0]['type'] == 'image' %}{{':'}}{% else %}{{': '}}{% endif %}{% for line in message['content'] %}{% if line['type'] == 'text' %}{{line['text']}}{% elif line['type'] == 'image' %}{{ '<image>' }}{% endif %}{% endfor %}{% endif %}<end_of_utterance>{% endfor %}{% if add_generation_prompt %}{{ 'Assistant:' }}{% endif %}
20 unmodified lines2122232425262792 unmodified lines1201211221231241251261271281291301314 unmodified lines13613713813914014114214314414520 unmodified lines"hidden_size": 16,"initializer_range": 0.02,"intermediate_size": 8192,"layer_types": null,"max_position_embeddings": 8192,"mlp_bias": false,"model_type": "llama",92 unmodified lines"vocab_size": 49280},"tie_word_embeddings": false,"transformers_version": "4.57.3","use_cache": false,"use_reentrant_checkpointing": false,"vision_config": {"attention_dropout": 0.0,"embed_dim": 64,"hidden_act": "gelu_pytorch_tanh","hidden_size": 16,"image_size": 384,4 unmodified lines"longest_edge": 384},"model_type": "smolvlm_vision","num_attention_heads": 4,"num_channels": 3,"num_hidden_layers": 2,"num_key_value_heads": 2,"patch_size": 14,"size": {"longest_edge": 192020 unmodified lines21222324252692 unmodified lines1191201211221231241251261271281294 unmodified lines13413513613713813914014114220 unmodified lines"hidden_size": 16,"initializer_range": 0.02,"intermediate_size": 8192,"max_position_embeddings": 8192,"mlp_bias": false,"model_type": "llama",92 unmodified lines"vocab_size": 49280},"tie_word_embeddings": false,"transformers_version": "4.56.2","use_cache": false,"use_reentrant_checkpointing": false,"vision_config": {"attention_dropout": 0.0,"hidden_act": "gelu_pytorch_tanh","hidden_size": 16,"image_size": 384,4 unmodified lines"longest_edge": 384},"model_type": "smolvlm_vision","num_attention_heads": 2,"num_channels": 3,"num_hidden_layers": 2,"patch_size": 14,"size": {"longest_edge": 1920
2 unmodified lines345672 unmodified lines"bos_token_id": 0,"eos_token_id": 49279,"pad_token_id": 2,"transformers_version": "4.57.3"}2 unmodified lines345672 unmodified lines"bos_token_id": 0,"eos_token_id": 49279,"pad_token_id": 2,"transformers_version": "4.56.2"}
123version https://git-lfs.github.com/spec/v1oid sha256:26d2b8159d50722e9e1853640f497d1a27460ad56f482a73f277222d16f379efsize 10798536123version https://git-lfs.github.com/spec/v1oid sha256:31a447c9d8c529b4fff16dc9e983a8cfbc1e435b6ed1203a13b094b9431f0193size 10798536
1234567{"version": "1.0","truncation": null,"padding": null,"added_tokens": [{"id": 0,1234567891011121314{"version": "1.0","truncation": null,"padding": {"strategy": "BatchLongest","direction": "Right","pad_to_multiple_of": null,"pad_id": 2,"pad_type_id": 0,"pad_token": "<|im_end|>"},"added_tokens": [{"id": 0,
27 unmodified lines282930313233341 unmodified line36373839404127 unmodified lines"longest_edge": 384},"num_frames": 64,"pad_size": null,"processor_class": "SmolVLMProcessor","resample": 1,"rescale_factor": 0.00392156862745098,1 unmodified line"size": {"longest_edge": 1536},"video_metadata": null,"video_processor_type": "SmolVLMVideoProcessor","video_sampling": {27 unmodified lines2829303132331 unmodified line3536373839404127 unmodified lines"longest_edge": 384},"num_frames": 64,"processor_class": "SmolVLMProcessor","resample": 1,"rescale_factor": 0.00392156862745098,1 unmodified line"size": {"longest_edge": 1536},"size_divisor": null,"video_metadata": null,"video_processor_type": "SmolVLMVideoProcessor","video_sampling": {
chat_template.jinja+1-1
config.json+2-5
generation_config.json+1-1
model.safetensors+1-1
tokenizer.json+8-1
video_preprocessor_config.json+1-1