Image-Text-to-Text
MLX
Safetensors
English
Chinese
visionpsy_nano
vlm
vision-language-model
apple-silicon
siglip2
smollm2
conversational
Instructions to use KaedeTai/VisionPsy-Nano-460M-Flash-MLX with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use KaedeTai/VisionPsy-Nano-460M-Flash-MLX 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("KaedeTai/VisionPsy-Nano-460M-Flash-MLX") config = load_config("KaedeTai/VisionPsy-Nano-460M-Flash-MLX") # 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
File size: 2,621 Bytes
5342068 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | {
"processor_class": "VisionPsyNanoProcessor",
"auto_map": {
"AutoProcessor": "processing_visionpsynano.VisionPsyNanoProcessor"
},
"is_flash": true,
"vit_img_size": 512,
"max_img_size": 2048,
"inference_max_img_size": null,
"resize_to_max_side_len": false,
"resize_min_side_len": 512,
"mp_image_token_length": 64,
"lm_max_position_embeddings": 8192,
"lm_tokenizer": "HuggingFaceTB/SmolLM2-360M-Instruct",
"lm_chat_template": "{% for message in messages %}{{'<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>' + '\n'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant\n' }}{% endif %}",
"vlm_extra_tokens": {
"image_token": "<|image|>",
"global_image_token": "<|global_image|>",
"r1c1": "<row_1_col_1>",
"r1c2": "<row_1_col_2>",
"r1c3": "<row_1_col_3>",
"r1c4": "<row_1_col_4>",
"r1c5": "<row_1_col_5>",
"r1c6": "<row_1_col_6>",
"r1c7": "<row_1_col_7>",
"r1c8": "<row_1_col_8>",
"r2c1": "<row_2_col_1>",
"r2c2": "<row_2_col_2>",
"r2c3": "<row_2_col_3>",
"r2c4": "<row_2_col_4>",
"r2c5": "<row_2_col_5>",
"r2c6": "<row_2_col_6>",
"r2c7": "<row_2_col_7>",
"r2c8": "<row_2_col_8>",
"r3c1": "<row_3_col_1>",
"r3c2": "<row_3_col_2>",
"r3c3": "<row_3_col_3>",
"r3c4": "<row_3_col_4>",
"r3c5": "<row_3_col_5>",
"r3c6": "<row_3_col_6>",
"r3c7": "<row_3_col_7>",
"r3c8": "<row_3_col_8>",
"r4c1": "<row_4_col_1>",
"r4c2": "<row_4_col_2>",
"r4c3": "<row_4_col_3>",
"r4c4": "<row_4_col_4>",
"r4c5": "<row_4_col_5>",
"r4c6": "<row_4_col_6>",
"r4c7": "<row_4_col_7>",
"r4c8": "<row_4_col_8>",
"r5c1": "<row_5_col_1>",
"r5c2": "<row_5_col_2>",
"r5c3": "<row_5_col_3>",
"r5c4": "<row_5_col_4>",
"r5c5": "<row_5_col_5>",
"r5c6": "<row_5_col_6>",
"r5c7": "<row_5_col_7>",
"r5c8": "<row_5_col_8>",
"r6c1": "<row_6_col_1>",
"r6c2": "<row_6_col_2>",
"r6c3": "<row_6_col_3>",
"r6c4": "<row_6_col_4>",
"r6c5": "<row_6_col_5>",
"r6c6": "<row_6_col_6>",
"r6c7": "<row_6_col_7>",
"r6c8": "<row_6_col_8>",
"r7c1": "<row_7_col_1>",
"r7c2": "<row_7_col_2>",
"r7c3": "<row_7_col_3>",
"r7c4": "<row_7_col_4>",
"r7c5": "<row_7_col_5>",
"r7c6": "<row_7_col_6>",
"r7c7": "<row_7_col_7>",
"r7c8": "<row_7_col_8>",
"r8c1": "<row_8_col_1>",
"r8c2": "<row_8_col_2>",
"r8c3": "<row_8_col_3>",
"r8c4": "<row_8_col_4>",
"r8c5": "<row_8_col_5>",
"r8c6": "<row_8_col_6>",
"r8c7": "<row_8_col_7>",
"r8c8": "<row_8_col_8>"
}
}
|