Image-Text-to-Text
Transformers
Safetensors
kimi_k25
feature-extraction
compressed-tensors
conversational
custom_code
Instructions to use amd-quark/Kimi-K2.5-2-layers-tiny with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use amd-quark/Kimi-K2.5-2-layers-tiny with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="amd-quark/Kimi-K2.5-2-layers-tiny", 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 AutoProcessor, AutoModel processor = AutoProcessor.from_pretrained("amd-quark/Kimi-K2.5-2-layers-tiny", trust_remote_code=True) model = AutoModel.from_pretrained("amd-quark/Kimi-K2.5-2-layers-tiny", trust_remote_code=True, 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=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use amd-quark/Kimi-K2.5-2-layers-tiny with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "amd-quark/Kimi-K2.5-2-layers-tiny" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "amd-quark/Kimi-K2.5-2-layers-tiny", "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/amd-quark/Kimi-K2.5-2-layers-tiny
- SGLang
How to use amd-quark/Kimi-K2.5-2-layers-tiny 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 "amd-quark/Kimi-K2.5-2-layers-tiny" \ --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": "amd-quark/Kimi-K2.5-2-layers-tiny", "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 "amd-quark/Kimi-K2.5-2-layers-tiny" \ --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": "amd-quark/Kimi-K2.5-2-layers-tiny", "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 amd-quark/Kimi-K2.5-2-layers-tiny with Docker Model Runner:
docker model run hf.co/amd-quark/Kimi-K2.5-2-layers-tiny
Upload config.json with huggingface_hub
Browse files- config.json +5 -3
config.json
CHANGED
|
@@ -38,10 +38,12 @@
|
|
| 38 |
},
|
| 39 |
"format": "pack-quantized",
|
| 40 |
"ignore": [
|
| 41 |
-
"lm_head",
|
| 42 |
"re:.*self_attn.*",
|
| 43 |
"re:.*shared_experts.*",
|
| 44 |
-
"re:.*mlp\\.(gate|up|gate_up|down)_proj.*"
|
|
|
|
|
|
|
|
|
|
| 45 |
],
|
| 46 |
"kv_cache_scheme": null,
|
| 47 |
"quant_method": "compressed-tensors",
|
|
@@ -222,4 +224,4 @@
|
|
| 222 |
"vt_num_attention_heads": 16,
|
| 223 |
"vt_num_hidden_layers": 27
|
| 224 |
}
|
| 225 |
-
}
|
|
|
|
| 38 |
},
|
| 39 |
"format": "pack-quantized",
|
| 40 |
"ignore": [
|
|
|
|
| 41 |
"re:.*self_attn.*",
|
| 42 |
"re:.*shared_experts.*",
|
| 43 |
+
"re:.*mlp\\.(gate|up|gate_up|down)_proj.*",
|
| 44 |
+
"re:.*lm_head.*",
|
| 45 |
+
"re:vision_tower.*",
|
| 46 |
+
"re:mm_projector.*"
|
| 47 |
],
|
| 48 |
"kv_cache_scheme": null,
|
| 49 |
"quant_method": "compressed-tensors",
|
|
|
|
| 224 |
"vt_num_attention_heads": 16,
|
| 225 |
"vt_num_hidden_layers": 27
|
| 226 |
}
|
| 227 |
+
}
|