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)# pip install -U transformers accelerate # 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- processor_config.json +0 -8
- tokenizer_config.json +0 -1
processor_config.json
CHANGED
|
@@ -13,12 +13,9 @@
|
|
| 13 |
},
|
| 14 |
"data_format": "channels_first",
|
| 15 |
"default_to_square": false,
|
| 16 |
-
"device": null,
|
| 17 |
-
"disable_grouping": null,
|
| 18 |
"do_center_crop": true,
|
| 19 |
"do_convert_rgb": true,
|
| 20 |
"do_normalize": true,
|
| 21 |
-
"do_pad": null,
|
| 22 |
"do_rescale": true,
|
| 23 |
"do_resize": true,
|
| 24 |
"image_mean": [
|
|
@@ -27,18 +24,13 @@
|
|
| 27 |
0.0
|
| 28 |
],
|
| 29 |
"image_processor_type": "FastVLMImageProcessor",
|
| 30 |
-
"image_seq_length": null,
|
| 31 |
"image_std": [
|
| 32 |
1.0,
|
| 33 |
1.0,
|
| 34 |
1.0
|
| 35 |
],
|
| 36 |
-
"input_data_format": null,
|
| 37 |
-
"pad_size": null,
|
| 38 |
-
"processor_class": "FastVLMProcessor",
|
| 39 |
"resample": 3,
|
| 40 |
"rescale_factor": 0.00392156862745098,
|
| 41 |
-
"return_tensors": null,
|
| 42 |
"size": {
|
| 43 |
"shortest_edge": 1024
|
| 44 |
}
|
|
|
|
| 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,
|
|
|
|
| 19 |
"do_rescale": true,
|
| 20 |
"do_resize": true,
|
| 21 |
"image_mean": [
|
|
|
|
| 24 |
0.0
|
| 25 |
],
|
| 26 |
"image_processor_type": "FastVLMImageProcessor",
|
|
|
|
| 27 |
"image_std": [
|
| 28 |
1.0,
|
| 29 |
1.0,
|
| 30 |
1.0
|
| 31 |
],
|
|
|
|
|
|
|
|
|
|
| 32 |
"resample": 3,
|
| 33 |
"rescale_factor": 0.00392156862745098,
|
|
|
|
| 34 |
"size": {
|
| 35 |
"shortest_edge": 1024
|
| 36 |
}
|
tokenizer_config.json
CHANGED
|
@@ -1,6 +1,5 @@
|
|
| 1 |
{
|
| 2 |
"add_prefix_space": false,
|
| 3 |
-
"additional_special_tokens": null,
|
| 4 |
"auto_map": {
|
| 5 |
"AutoProcessor": "processing_fastvlm.FastVLMProcessor"
|
| 6 |
},
|
|
|
|
| 1 |
{
|
| 2 |
"add_prefix_space": false,
|
|
|
|
| 3 |
"auto_map": {
|
| 4 |
"AutoProcessor": "processing_fastvlm.FastVLMProcessor"
|
| 5 |
},
|