Image-to-Text
Transformers
Safetensors
Japanese
English
sarashina2_vision
text-generation
multimodal
ocr
document-understanding
vision-language
custom_code
Instructions to use subhash4face/sarashina2.2-ocr with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use subhash4face/sarashina2.2-ocr with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "image-to-text" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # 'pip install "transformers<5.0.0' from transformers import pipeline pipe = pipeline("image-to-text", model="subhash4face/sarashina2.2-ocr", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("subhash4face/sarashina2.2-ocr", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
| { | |
| "architectures": [ | |
| "Sarashina2VisionForCausalLM" | |
| ], | |
| "auto_map": { | |
| "AutoConfig": "configuration_sarashina2_vision.Sarashina2VisionConfig", | |
| "AutoModelForCausalLM": "modeling_sarashina2_vision.Sarashina2VisionForCausalLM" | |
| }, | |
| "bos_token_id": 1, | |
| "dtype": "bfloat16", | |
| "eos_token_id": 2, | |
| "hidden_act": "silu", | |
| "image_token_id": 14, | |
| "model_type": "sarashina2_vision", | |
| "pad_token_id": 3, | |
| "rope_scaling": { | |
| "mrope_interleaved": true, | |
| "mrope_section": [ | |
| 20, | |
| 30, | |
| 30 | |
| ], | |
| "rope_type": "default", | |
| "spatial_reset": true | |
| }, | |
| "text_config": { | |
| "_name_or_path": "sbintuitions/sarashina2.2-3b-instruct-v0.1", | |
| "architectures": [ | |
| "LlamaForCausalLM" | |
| ], | |
| "attention_bias": false, | |
| "attention_dropout": 0.0, | |
| "dtype": "bfloat16", | |
| "head_dim": 160, | |
| "hidden_act": "silu", | |
| "hidden_size": 2560, | |
| "initializer_range": 0.02, | |
| "intermediate_size": 8960, | |
| "max_position_embeddings": 16384, | |
| "mlp_bias": false, | |
| "model_type": "llama", | |
| "num_attention_heads": 16, | |
| "num_hidden_layers": 32, | |
| "num_key_value_heads": 8, | |
| "pretraining_tp": 1, | |
| "rms_norm_eps": 1e-05, | |
| "rope_scaling": null, | |
| "rope_theta": 500000, | |
| "use_cache": true, | |
| "vocab_size": 102400 | |
| }, | |
| "transformers_version": "4.57.1", | |
| "video_token_id": 102399, | |
| "vision_config": { | |
| "deepstack_visual_indices": [ | |
| 6, | |
| 13, | |
| 20 | |
| ], | |
| "depth": 27, | |
| "embed_dim": 1152, | |
| "hidden_act": "gelu_pytorch_tanh", | |
| "hidden_size": 2560, | |
| "in_channels": 3, | |
| "initializer_range": 0.02, | |
| "mlp_ratio": 3.7362, | |
| "model_type": "qwen2_vl", | |
| "num_heads": 16, | |
| "patch_size": 14, | |
| "spatial_merge_size": 2, | |
| "temporal_patch_size": 2 | |
| }, | |
| "vision_end_token_id": 102398, | |
| "vision_start_token_id": 102397, | |
| "vocab_size": 102400 | |
| } | |