Image-Text-to-Text
MLX
Safetensors
English
qwen2_vl
mlx-vlm
apple-silicon
conversational
gui
vision-language-model
uground
grounding
computer-use
agent
2b
bf16
Instructions to use mlx-community/UGround-V1-2B-bf16 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use mlx-community/UGround-V1-2B-bf16 with MLX:
# Make sure mlx-vlm is installed # pip install --upgrade mlx-vlm from mlx_vlm import load, generate from mlx_vlm.prompt_utils import apply_chat_template from mlx_vlm.utils import load_config # Load the model model, processor = load("mlx-community/UGround-V1-2B-bf16") config = load_config("mlx-community/UGround-V1-2B-bf16") # Prepare input image = ["http://images.cocodataset.org/val2017/000000039769.jpg"] prompt = "Describe this image." # Apply chat template formatted_prompt = apply_chat_template( processor, config, prompt, num_images=1 ) # Generate output output = generate(model, processor, formatted_prompt, image) print(output) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Atomic Chat
Download config.json from mlx-community/UGround-V1-2B-bf16: direct link, hf CLI and curl.
- Browser
- Download file 1.18 kB
-
https://huggingface.co/mlx-community/UGround-V1-2B-bf16/resolve/main/config.json
- Command line
-
hf download hf://mlx-community/UGround-V1-2B-bf16/config.json
-
curl -L -o config.json https://huggingface.co/mlx-community/UGround-V1-2B-bf16/resolve/main/config.json
1.18 kB
| { | |
| "architectures": [ | |
| "Qwen2VLForConditionalGeneration" | |
| ], | |
| "attention_dropout": 0.0, | |
| "bos_token_id": 151643, | |
| "eos_token_id": 151645, | |
| "hidden_act": "silu", | |
| "hidden_size": 1536, | |
| "image_token_id": 151655, | |
| "initializer_range": 0.02, | |
| "intermediate_size": 8960, | |
| "max_position_embeddings": 32768, | |
| "max_window_layers": 28, | |
| "model_type": "qwen2_vl", | |
| "num_attention_heads": 12, | |
| "num_hidden_layers": 28, | |
| "num_key_value_heads": 2, | |
| "rms_norm_eps": 1e-06, | |
| "rope_scaling": { | |
| "mrope_section": [ | |
| 16, | |
| 24, | |
| 24 | |
| ], | |
| "rope_type": "default", | |
| "type": "default" | |
| }, | |
| "rope_theta": 1000000.0, | |
| "sliding_window": 32768, | |
| "tie_word_embeddings": true, | |
| "transformers_version": "4.46.1", | |
| "use_cache": false, | |
| "use_sliding_window": false, | |
| "video_token_id": 151656, | |
| "vision_config": { | |
| "hidden_size": 1536, | |
| "in_chans": 3, | |
| "model_type": "qwen2_vl", | |
| "spatial_patch_size": 14 | |
| }, | |
| "vision_end_token_id": 151653, | |
| "vision_start_token_id": 151652, | |
| "vision_token_id": 151654, | |
| "vocab_size": 151936 | |
| } |