Image-Text-to-Text
MLX
Safetensors
multilingual
internvl_chat
vision-language
ocr
document-intelligence
qianfan
apple-silicon
custom_code
Eval Results
4-bit precision
Instructions to use jason1966/Qianfan-OCR-MLX-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use jason1966/Qianfan-OCR-MLX-4bit 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("jason1966/Qianfan-OCR-MLX-4bit") config = load_config("jason1966/Qianfan-OCR-MLX-4bit") # 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
Upload config.json with huggingface_hub
Browse files- config.json +100 -0
config.json
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"InternVLChatModel"
|
| 4 |
+
],
|
| 5 |
+
"auto_map": {
|
| 6 |
+
"AutoConfig": "configuration_internvl_chat.InternVLChatConfig",
|
| 7 |
+
"AutoModel": "modeling_internvl_chat.InternVLChatModel",
|
| 8 |
+
"AutoModelForCausalLM": "modeling_internvl_chat.InternVLChatModel"
|
| 9 |
+
},
|
| 10 |
+
"downsample_ratio": 0.5,
|
| 11 |
+
"dynamic_image_size": true,
|
| 12 |
+
"eos_token_id": 151645,
|
| 13 |
+
"force_image_size": 448,
|
| 14 |
+
"llm_config": {
|
| 15 |
+
"architectures": [
|
| 16 |
+
"Qwen3ForCausalLM"
|
| 17 |
+
],
|
| 18 |
+
"attention_bias": false,
|
| 19 |
+
"attention_dropout": 0.0,
|
| 20 |
+
"bos_token_id": 151643,
|
| 21 |
+
"debug": false,
|
| 22 |
+
"eos_token_id": 151645,
|
| 23 |
+
"ep_size": 1,
|
| 24 |
+
"head_dim": 128,
|
| 25 |
+
"hidden_act": "silu",
|
| 26 |
+
"hidden_size": 2560,
|
| 27 |
+
"initializer_range": 0.02,
|
| 28 |
+
"intermediate_size": 9728,
|
| 29 |
+
"max_position_embeddings": 32768,
|
| 30 |
+
"max_window_layers": 36,
|
| 31 |
+
"micro_forward": false,
|
| 32 |
+
"model_type": "qwen3",
|
| 33 |
+
"num_attention_heads": 32,
|
| 34 |
+
"num_hidden_layers": 36,
|
| 35 |
+
"num_key_value_heads": 8,
|
| 36 |
+
"rms_norm_eps": 1e-06,
|
| 37 |
+
"rope_scaling": null,
|
| 38 |
+
"rope_theta": 5000000,
|
| 39 |
+
"skip_checkpoint": false,
|
| 40 |
+
"sliding_window": null,
|
| 41 |
+
"torch_dtype": "bfloat16",
|
| 42 |
+
"use_cache": false,
|
| 43 |
+
"use_deepep": false,
|
| 44 |
+
"use_sliding_window": false,
|
| 45 |
+
"vocab_size": 153678
|
| 46 |
+
},
|
| 47 |
+
"max_dynamic_patch": 12,
|
| 48 |
+
"min_dynamic_patch": 1,
|
| 49 |
+
"model_type": "internvl_chat",
|
| 50 |
+
"pad2square": false,
|
| 51 |
+
"pad_token_id": 151643,
|
| 52 |
+
"ps_version": "v2",
|
| 53 |
+
"quantization": {
|
| 54 |
+
"group_size": 64,
|
| 55 |
+
"bits": 4,
|
| 56 |
+
"mode": "affine"
|
| 57 |
+
},
|
| 58 |
+
"quantization_config": {
|
| 59 |
+
"group_size": 64,
|
| 60 |
+
"bits": 4,
|
| 61 |
+
"mode": "affine"
|
| 62 |
+
},
|
| 63 |
+
"select_layer": -1,
|
| 64 |
+
"template": "qianfanvl",
|
| 65 |
+
"tie_word_embeddings": false,
|
| 66 |
+
"transformers_version": null,
|
| 67 |
+
"use_backbone_lora": 0,
|
| 68 |
+
"use_llm_lora": 0,
|
| 69 |
+
"use_thumbnail": true,
|
| 70 |
+
"vision_config": {
|
| 71 |
+
"architectures": [
|
| 72 |
+
"InternVisionModel"
|
| 73 |
+
],
|
| 74 |
+
"attention_dropout": 0.0,
|
| 75 |
+
"auto_map": {
|
| 76 |
+
"AutoConfig": "configuration_intern_vit.InternVisionConfig",
|
| 77 |
+
"AutoModel": "modeling_intern_vit.InternVisionModel"
|
| 78 |
+
},
|
| 79 |
+
"drop_path_rate": 0.1,
|
| 80 |
+
"dropout": 0.0,
|
| 81 |
+
"hidden_act": "gelu",
|
| 82 |
+
"hidden_size": 1024,
|
| 83 |
+
"image_size": 448,
|
| 84 |
+
"initializer_factor": 1.0,
|
| 85 |
+
"initializer_range": 0.02,
|
| 86 |
+
"intermediate_size": 4096,
|
| 87 |
+
"layer_norm_eps": 1e-06,
|
| 88 |
+
"model_type": "intern_vit_6b",
|
| 89 |
+
"norm_type": "layer_norm",
|
| 90 |
+
"num_attention_heads": 16,
|
| 91 |
+
"num_channels": 3,
|
| 92 |
+
"num_hidden_layers": 24,
|
| 93 |
+
"patch_size": 14,
|
| 94 |
+
"qk_normalization": false,
|
| 95 |
+
"qkv_bias": true,
|
| 96 |
+
"torch_dtype": "bfloat16",
|
| 97 |
+
"use_fa3": false,
|
| 98 |
+
"use_flash_attn": true
|
| 99 |
+
}
|
| 100 |
+
}
|