Image-Text-to-Text
MLX
Safetensors
Transformers
llava_qwen2
text-generation
conversational
custom_code
8-bit precision
Instructions to use EZCon/FastVLM-1.5B-8bit-mlx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use EZCon/FastVLM-1.5B-8bit-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("EZCon/FastVLM-1.5B-8bit-mlx") config = load_config("EZCon/FastVLM-1.5B-8bit-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) - Transformers
How to use EZCon/FastVLM-1.5B-8bit-mlx with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="EZCon/FastVLM-1.5B-8bit-mlx", 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 AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("EZCon/FastVLM-1.5B-8bit-mlx", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- vLLM
How to use EZCon/FastVLM-1.5B-8bit-mlx with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "EZCon/FastVLM-1.5B-8bit-mlx" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "EZCon/FastVLM-1.5B-8bit-mlx", "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/EZCon/FastVLM-1.5B-8bit-mlx
- SGLang
How to use EZCon/FastVLM-1.5B-8bit-mlx 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 "EZCon/FastVLM-1.5B-8bit-mlx" \ --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": "EZCon/FastVLM-1.5B-8bit-mlx", "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 "EZCon/FastVLM-1.5B-8bit-mlx" \ --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": "EZCon/FastVLM-1.5B-8bit-mlx", "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 EZCon/FastVLM-1.5B-8bit-mlx with Docker Model Runner:
docker model run hf.co/EZCon/FastVLM-1.5B-8bit-mlx
- Atomic Chat
Upload folder using huggingface_hub
Browse files- README.md +1 -1
- processor_config.json +0 -9
- tokenizer_config.json +0 -3
README.md
CHANGED
|
@@ -7,7 +7,7 @@ tags:
|
|
| 7 |
---
|
| 8 |
|
| 9 |
# EZCon/FastVLM-1.5B-8bit-mlx
|
| 10 |
-
This model was converted to MLX format from [`apple/FastVLM-1.5B`]() using mlx-vlm version **0.3.
|
| 11 |
Refer to the [original model card](https://huggingface.co/apple/FastVLM-1.5B) for more details on the model.
|
| 12 |
## Use with mlx
|
| 13 |
|
|
|
|
| 7 |
---
|
| 8 |
|
| 9 |
# EZCon/FastVLM-1.5B-8bit-mlx
|
| 10 |
+
This model was converted to MLX format from [`apple/FastVLM-1.5B`]() using mlx-vlm version **0.3.12**.
|
| 11 |
Refer to the [original model card](https://huggingface.co/apple/FastVLM-1.5B) for more details on the model.
|
| 12 |
## Use with mlx
|
| 13 |
|
processor_config.json
CHANGED
|
@@ -1,18 +1,9 @@
|
|
| 1 |
{
|
| 2 |
-
"auto_map": {
|
| 3 |
-
"AutoProcessor": "processing_fastvlm.FastVLMProcessor"
|
| 4 |
-
},
|
| 5 |
"image_processor": {
|
| 6 |
-
"auto_map": {
|
| 7 |
-
"AutoImageProcessor": "processing_fastvlm.FastVLMImageProcessor",
|
| 8 |
-
"AutoProcessor": "processing_fastvlm.FastVLMProcessor"
|
| 9 |
-
},
|
| 10 |
"crop_size": {
|
| 11 |
"height": 1024,
|
| 12 |
"width": 1024
|
| 13 |
},
|
| 14 |
-
"data_format": "channels_first",
|
| 15 |
-
"default_to_square": false,
|
| 16 |
"do_center_crop": true,
|
| 17 |
"do_convert_rgb": true,
|
| 18 |
"do_normalize": true,
|
|
|
|
| 1 |
{
|
|
|
|
|
|
|
|
|
|
| 2 |
"image_processor": {
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
"crop_size": {
|
| 4 |
"height": 1024,
|
| 5 |
"width": 1024
|
| 6 |
},
|
|
|
|
|
|
|
| 7 |
"do_center_crop": true,
|
| 8 |
"do_convert_rgb": true,
|
| 9 |
"do_normalize": true,
|
tokenizer_config.json
CHANGED
|
@@ -1,8 +1,5 @@
|
|
| 1 |
{
|
| 2 |
"add_prefix_space": false,
|
| 3 |
-
"auto_map": {
|
| 4 |
-
"AutoProcessor": "processing_fastvlm.FastVLMProcessor"
|
| 5 |
-
},
|
| 6 |
"backend": "tokenizers",
|
| 7 |
"bos_token": null,
|
| 8 |
"clean_up_tokenization_spaces": false,
|
|
|
|
| 1 |
{
|
| 2 |
"add_prefix_space": false,
|
|
|
|
|
|
|
|
|
|
| 3 |
"backend": "tokenizers",
|
| 4 |
"bos_token": null,
|
| 5 |
"clean_up_tokenization_spaces": false,
|