Image-Text-to-Text
Transformers
Safetensors
kimi_vl
feature-extraction
conversational
custom_code
Eval Results
Instructions to use moonshotai/Kimi-VL-A3B-Thinking-2506 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use moonshotai/Kimi-VL-A3B-Thinking-2506 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="moonshotai/Kimi-VL-A3B-Thinking-2506", trust_remote_code=True) 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)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("moonshotai/Kimi-VL-A3B-Thinking-2506", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use moonshotai/Kimi-VL-A3B-Thinking-2506 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "moonshotai/Kimi-VL-A3B-Thinking-2506" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "moonshotai/Kimi-VL-A3B-Thinking-2506", "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/moonshotai/Kimi-VL-A3B-Thinking-2506
- SGLang
How to use moonshotai/Kimi-VL-A3B-Thinking-2506 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 "moonshotai/Kimi-VL-A3B-Thinking-2506" \ --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": "moonshotai/Kimi-VL-A3B-Thinking-2506", "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 "moonshotai/Kimi-VL-A3B-Thinking-2506" \ --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": "moonshotai/Kimi-VL-A3B-Thinking-2506", "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 moonshotai/Kimi-VL-A3B-Thinking-2506 with Docker Model Runner:
docker model run hf.co/moonshotai/Kimi-VL-A3B-Thinking-2506
remove _validate_images_text_input_order as well (#11)
Browse files- remove _validate_images_text_input_order (6bd580e019050d4ca04dc317a70df881628c1cb6)
- processing_kimi_vl.py +1 -3
processing_kimi_vl.py
CHANGED
|
@@ -22,7 +22,7 @@ from typing import List, Union
|
|
| 22 |
|
| 23 |
from transformers.feature_extraction_utils import BatchFeature
|
| 24 |
from transformers.image_utils import ImageInput
|
| 25 |
-
from transformers.processing_utils import ProcessingKwargs, ProcessorMixin, Unpack
|
| 26 |
from transformers.tokenization_utils_base import PreTokenizedInput, TextInput
|
| 27 |
from transformers.utils import logging
|
| 28 |
|
|
@@ -110,8 +110,6 @@ class KimiVLProcessor(ProcessorMixin):
|
|
| 110 |
if images is None and text is None:
|
| 111 |
raise ValueError("You have to specify at least one of `images` or `text`.")
|
| 112 |
|
| 113 |
-
# check if images and text inputs are reversed for BC
|
| 114 |
-
images, text = _validate_images_text_input_order(images, text)
|
| 115 |
|
| 116 |
output_kwargs = self._merge_kwargs(
|
| 117 |
KimiVLProcessorKwargs,
|
|
|
|
| 22 |
|
| 23 |
from transformers.feature_extraction_utils import BatchFeature
|
| 24 |
from transformers.image_utils import ImageInput
|
| 25 |
+
from transformers.processing_utils import ProcessingKwargs, ProcessorMixin, Unpack
|
| 26 |
from transformers.tokenization_utils_base import PreTokenizedInput, TextInput
|
| 27 |
from transformers.utils import logging
|
| 28 |
|
|
|
|
| 110 |
if images is None and text is None:
|
| 111 |
raise ValueError("You have to specify at least one of `images` or `text`.")
|
| 112 |
|
|
|
|
|
|
|
| 113 |
|
| 114 |
output_kwargs = self._merge_kwargs(
|
| 115 |
KimiVLProcessorKwargs,
|