Instructions to use XiaomiMiMo/MiMo-VL-7B-SFT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use XiaomiMiMo/MiMo-VL-7B-SFT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="XiaomiMiMo/MiMo-VL-7B-SFT") 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("XiaomiMiMo/MiMo-VL-7B-SFT") model = AutoModelForMultimodalLM.from_pretrained("XiaomiMiMo/MiMo-VL-7B-SFT", 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 XiaomiMiMo/MiMo-VL-7B-SFT with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "XiaomiMiMo/MiMo-VL-7B-SFT" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "XiaomiMiMo/MiMo-VL-7B-SFT", "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/XiaomiMiMo/MiMo-VL-7B-SFT
- SGLang
How to use XiaomiMiMo/MiMo-VL-7B-SFT 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 "XiaomiMiMo/MiMo-VL-7B-SFT" \ --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": "XiaomiMiMo/MiMo-VL-7B-SFT", "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 "XiaomiMiMo/MiMo-VL-7B-SFT" \ --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": "XiaomiMiMo/MiMo-VL-7B-SFT", "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 XiaomiMiMo/MiMo-VL-7B-SFT with Docker Model Runner:
docker model run hf.co/XiaomiMiMo/MiMo-VL-7B-SFT
Add pipeline tag and link to code
#2
by nielsr HF Staff - opened
README.md
CHANGED
|
@@ -1,9 +1,11 @@
|
|
| 1 |
---
|
| 2 |
-
license: mit
|
| 3 |
-
library_name: transformers
|
| 4 |
base_model:
|
| 5 |
- XiaomiMiMo/MiMo-VL-7B-SFT
|
|
|
|
|
|
|
|
|
|
| 6 |
---
|
|
|
|
| 7 |
<div align="center">
|
| 8 |
<picture>
|
| 9 |
<source srcset="https://github.com/XiaomiMiMo/MiMo-VL/raw/main/figures/Xiaomi_MiMo_darkmode.png?raw=true" media="(prefers-color-scheme: dark)">
|
|
@@ -32,6 +34,8 @@ base_model:
|
|
| 32 |
|
|
| 33 |
<a href="https://github.com/XiaomiMiMo/MiMo-VL/blob/main/MiMo-VL-Technical-Report.pdf" target="_blank">📔 Technical Report</a>
|
| 34 |
|
|
|
|
|
|
|
|
| 35 |
<br/>
|
| 36 |
</div>
|
| 37 |
|
|
@@ -127,7 +131,6 @@ The MiMo-VL-7B series maintain full compatibility with the `Qwen2_5_VLForConditi
|
|
| 127 |
}
|
| 128 |
```
|
| 129 |
|
| 130 |
-
|
| 131 |
## VI. Contact
|
| 132 |
|
| 133 |
-
Please contact us at [mimo@xiaomi.com](mailto:mimo@xiaomi.com) or open an issue if you have any questions.
|
|
|
|
| 1 |
---
|
|
|
|
|
|
|
| 2 |
base_model:
|
| 3 |
- XiaomiMiMo/MiMo-VL-7B-SFT
|
| 4 |
+
library_name: transformers
|
| 5 |
+
license: mit
|
| 6 |
+
pipeline_tag: image-text-to-text
|
| 7 |
---
|
| 8 |
+
|
| 9 |
<div align="center">
|
| 10 |
<picture>
|
| 11 |
<source srcset="https://github.com/XiaomiMiMo/MiMo-VL/raw/main/figures/Xiaomi_MiMo_darkmode.png?raw=true" media="(prefers-color-scheme: dark)">
|
|
|
|
| 34 |
|
|
| 35 |
<a href="https://github.com/XiaomiMiMo/MiMo-VL/blob/main/MiMo-VL-Technical-Report.pdf" target="_blank">📔 Technical Report</a>
|
| 36 |
|
|
| 37 |
+
<a href="https://github.com/XiaomiMiMo/MiMo-VL" target="_blank">💻 Github Repo</a>
|
| 38 |
+
|
|
| 39 |
<br/>
|
| 40 |
</div>
|
| 41 |
|
|
|
|
| 131 |
}
|
| 132 |
```
|
| 133 |
|
|
|
|
| 134 |
## VI. Contact
|
| 135 |
|
| 136 |
+
Please contact us at [mimo@xiaomi.com](mailto:mimo@xiaomi.com) or open an issue if you have any questions.
|