Image-Text-to-Text
MLX
Safetensors
English
falcon_ocr
ocr
vision-language
falcon
apple-silicon
custom_code
Eval Results
Instructions to use mlx-community/Falcon-OCR-bf16 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use mlx-community/Falcon-OCR-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/Falcon-OCR-bf16") config = load_config("mlx-community/Falcon-OCR-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
- LM Studio
| { | |
| "architectures": [ | |
| "FalconOCRForCausalLM" | |
| ], | |
| "auto_map": { | |
| "AutoConfig": "configuration_falcon_ocr.FalconOCRConfig", | |
| "AutoModelForCausalLM": "modeling_falcon_ocr.FalconOCRForCausalLM" | |
| }, | |
| "model_type": "falcon_ocr", | |
| "torch_dtype": "float32", | |
| "dim": 768, | |
| "n_layers": 22, | |
| "n_heads": 16, | |
| "head_dim": 64, | |
| "n_kv_heads": 8, | |
| "vocab_size": 65536, | |
| "ffn_dim": 2304, | |
| "norm_eps": 1e-05, | |
| "max_seq_len": 8192, | |
| "rope_theta": 10000, | |
| "channel_size": 3, | |
| "spatial_patch_size": 16, | |
| "temporal_patch_size": 1, | |
| "eos_id": 11, | |
| "img_id": 227, | |
| "image_cls_token_id": 244, | |
| "image_reg_1_token_id": 245, | |
| "image_reg_2_token_id": 246, | |
| "image_reg_3_token_id": 247, | |
| "image_reg_4_token_id": 248, | |
| "img_end_id": 230 | |
| } |