staghado/LightOnOCR-2-1B-1025-ft-iam
Browse files- .gitattributes +1 -0
- README.md +56 -0
- chat_template.jinja +26 -0
- config.json +99 -0
- generation_config.json +13 -0
- model.safetensors +3 -0
- processor_config.json +30 -0
- tokenizer.json +3 -0
- tokenizer_config.json +38 -0
- training_args.bin +3 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: transformers
|
| 3 |
+
license: apache-2.0
|
| 4 |
+
base_model: lightonai/LightOnOCR-2-1B-base
|
| 5 |
+
tags:
|
| 6 |
+
- generated_from_trainer
|
| 7 |
+
model-index:
|
| 8 |
+
- name: LightOnOCR-2-ft-iam
|
| 9 |
+
results: []
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
| 13 |
+
should probably proofread and complete it, then remove this comment. -->
|
| 14 |
+
|
| 15 |
+
# LightOnOCR-2-ft-iam
|
| 16 |
+
|
| 17 |
+
This model is a fine-tuned version of [lightonai/LightOnOCR-2-1B-base](https://huggingface.co/lightonai/LightOnOCR-2-1B-base) on an unknown dataset.
|
| 18 |
+
|
| 19 |
+
## Model description
|
| 20 |
+
|
| 21 |
+
More information needed
|
| 22 |
+
|
| 23 |
+
## Intended uses & limitations
|
| 24 |
+
|
| 25 |
+
More information needed
|
| 26 |
+
|
| 27 |
+
## Training and evaluation data
|
| 28 |
+
|
| 29 |
+
More information needed
|
| 30 |
+
|
| 31 |
+
## Training procedure
|
| 32 |
+
|
| 33 |
+
### Training hyperparameters
|
| 34 |
+
|
| 35 |
+
The following hyperparameters were used during training:
|
| 36 |
+
- learning_rate: 6e-05
|
| 37 |
+
- train_batch_size: 4
|
| 38 |
+
- eval_batch_size: 6
|
| 39 |
+
- seed: 42
|
| 40 |
+
- gradient_accumulation_steps: 4
|
| 41 |
+
- total_train_batch_size: 16
|
| 42 |
+
- optimizer: Use OptimizerNames.ADAMW_TORCH_FUSED with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
|
| 43 |
+
- lr_scheduler_type: linear
|
| 44 |
+
- lr_scheduler_warmup_steps: 10
|
| 45 |
+
- num_epochs: 1
|
| 46 |
+
|
| 47 |
+
### Training results
|
| 48 |
+
|
| 49 |
+
|
| 50 |
+
|
| 51 |
+
### Framework versions
|
| 52 |
+
|
| 53 |
+
- Transformers 5.0.0.dev0
|
| 54 |
+
- Pytorch 2.9.0+cu126
|
| 55 |
+
- Datasets 4.5.0
|
| 56 |
+
- Tokenizers 0.22.2
|
chat_template.jinja
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{% set image_count = namespace(value=0) %}
|
| 2 |
+
{% for message in messages %}
|
| 3 |
+
{% if loop.first and message['role'] != 'system' %}
|
| 4 |
+
<|im_start|>system<|im_end|>
|
| 5 |
+
{% endif %}
|
| 6 |
+
<|im_start|>{{ message['role'] }}
|
| 7 |
+
{% if message['content'] is string %}
|
| 8 |
+
{{ message['content'] }}<|im_end|>
|
| 9 |
+
{% else %}
|
| 10 |
+
{% for content in message['content'] %}
|
| 11 |
+
{% if content['type'] == 'image' or 'image' in content or 'image_url' in content %}
|
| 12 |
+
{% set image_count.value = image_count.value + 1 %}
|
| 13 |
+
{% if add_vision_id %}
|
| 14 |
+
Picture {{ image_count.value }}:
|
| 15 |
+
{% endif -%}
|
| 16 |
+
<|image_pad|>
|
| 17 |
+
{%- elif 'text' in content %}
|
| 18 |
+
{{ content['text'] }}
|
| 19 |
+
{% endif %}
|
| 20 |
+
{% endfor %}
|
| 21 |
+
<|im_end|>
|
| 22 |
+
{% endif %}
|
| 23 |
+
{% endfor %}
|
| 24 |
+
{% if add_generation_prompt %}
|
| 25 |
+
<|im_start|>assistant
|
| 26 |
+
{% endif %}
|
config.json
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"LightOnOcrForConditionalGeneration"
|
| 4 |
+
],
|
| 5 |
+
"dtype": "bfloat16",
|
| 6 |
+
"eos_token_id": 151645,
|
| 7 |
+
"image_token_id": 151655,
|
| 8 |
+
"model_type": "lighton_ocr",
|
| 9 |
+
"multimodal_projector_bias": false,
|
| 10 |
+
"pad_token_id": 151643,
|
| 11 |
+
"projector_hidden_act": "gelu",
|
| 12 |
+
"spatial_merge_size": 2,
|
| 13 |
+
"text_config": {
|
| 14 |
+
"architectures": [
|
| 15 |
+
"Qwen3ForCausalLM"
|
| 16 |
+
],
|
| 17 |
+
"attention_bias": false,
|
| 18 |
+
"attention_dropout": 0,
|
| 19 |
+
"bos_token_id": null,
|
| 20 |
+
"dtype": "bfloat16",
|
| 21 |
+
"eos_token_id": null,
|
| 22 |
+
"head_dim": 128,
|
| 23 |
+
"hidden_act": "silu",
|
| 24 |
+
"hidden_size": 1024,
|
| 25 |
+
"initializer_range": 0.02,
|
| 26 |
+
"intermediate_size": 3072,
|
| 27 |
+
"layer_types": [
|
| 28 |
+
"full_attention",
|
| 29 |
+
"full_attention",
|
| 30 |
+
"full_attention",
|
| 31 |
+
"full_attention",
|
| 32 |
+
"full_attention",
|
| 33 |
+
"full_attention",
|
| 34 |
+
"full_attention",
|
| 35 |
+
"full_attention",
|
| 36 |
+
"full_attention",
|
| 37 |
+
"full_attention",
|
| 38 |
+
"full_attention",
|
| 39 |
+
"full_attention",
|
| 40 |
+
"full_attention",
|
| 41 |
+
"full_attention",
|
| 42 |
+
"full_attention",
|
| 43 |
+
"full_attention",
|
| 44 |
+
"full_attention",
|
| 45 |
+
"full_attention",
|
| 46 |
+
"full_attention",
|
| 47 |
+
"full_attention",
|
| 48 |
+
"full_attention",
|
| 49 |
+
"full_attention",
|
| 50 |
+
"full_attention",
|
| 51 |
+
"full_attention",
|
| 52 |
+
"full_attention",
|
| 53 |
+
"full_attention",
|
| 54 |
+
"full_attention",
|
| 55 |
+
"full_attention"
|
| 56 |
+
],
|
| 57 |
+
"max_position_embeddings": 16384,
|
| 58 |
+
"max_window_layers": 28,
|
| 59 |
+
"model_type": "qwen3",
|
| 60 |
+
"num_attention_heads": 16,
|
| 61 |
+
"num_hidden_layers": 28,
|
| 62 |
+
"num_key_value_heads": 8,
|
| 63 |
+
"pad_token_id": null,
|
| 64 |
+
"rms_norm_eps": 1e-06,
|
| 65 |
+
"rope_parameters": {
|
| 66 |
+
"rope_theta": 1000000,
|
| 67 |
+
"rope_type": "default"
|
| 68 |
+
},
|
| 69 |
+
"sliding_window": null,
|
| 70 |
+
"tie_word_embeddings": true,
|
| 71 |
+
"use_cache": true,
|
| 72 |
+
"use_qk_norm": true,
|
| 73 |
+
"use_sliding_window": false,
|
| 74 |
+
"vocab_size": 151936
|
| 75 |
+
},
|
| 76 |
+
"tie_word_embeddings": true,
|
| 77 |
+
"transformers_version": "5.0.0.dev0",
|
| 78 |
+
"use_cache": false,
|
| 79 |
+
"vision_config": {
|
| 80 |
+
"attention_dropout": 0,
|
| 81 |
+
"dtype": "bfloat16",
|
| 82 |
+
"head_dim": 64,
|
| 83 |
+
"hidden_act": "silu",
|
| 84 |
+
"hidden_size": 1024,
|
| 85 |
+
"image_size": 1540,
|
| 86 |
+
"initializer_range": 0.02,
|
| 87 |
+
"intermediate_size": 4096,
|
| 88 |
+
"model_type": "pixtral",
|
| 89 |
+
"num_attention_heads": 16,
|
| 90 |
+
"num_channels": 3,
|
| 91 |
+
"num_hidden_layers": 24,
|
| 92 |
+
"patch_size": 14,
|
| 93 |
+
"rope_parameters": {
|
| 94 |
+
"rope_theta": 10000,
|
| 95 |
+
"rope_type": "default"
|
| 96 |
+
}
|
| 97 |
+
},
|
| 98 |
+
"vision_feature_layer": -1
|
| 99 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bos_token_id": 151643,
|
| 3 |
+
"do_sample": true,
|
| 4 |
+
"eos_token_id": [
|
| 5 |
+
151645,
|
| 6 |
+
151643
|
| 7 |
+
],
|
| 8 |
+
"pad_token_id": 151643,
|
| 9 |
+
"temperature": 0.2,
|
| 10 |
+
"top_k": 0,
|
| 11 |
+
"top_p": 0.9,
|
| 12 |
+
"transformers_version": "5.0.0.dev0"
|
| 13 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a3bf74ad1652345a30edaa25632d94e3698badfc950d0fd845b09963f10e1031
|
| 3 |
+
size 2011367496
|
processor_config.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"image_processor": {
|
| 3 |
+
"data_format": "channels_first",
|
| 4 |
+
"default_to_square": true,
|
| 5 |
+
"do_convert_rgb": true,
|
| 6 |
+
"do_normalize": true,
|
| 7 |
+
"do_rescale": true,
|
| 8 |
+
"do_resize": true,
|
| 9 |
+
"image_mean": [
|
| 10 |
+
0.48145466,
|
| 11 |
+
0.4578275,
|
| 12 |
+
0.40821073
|
| 13 |
+
],
|
| 14 |
+
"image_processor_type": "PixtralImageProcessorFast",
|
| 15 |
+
"image_std": [
|
| 16 |
+
0.26862954,
|
| 17 |
+
0.26130258,
|
| 18 |
+
0.27577711
|
| 19 |
+
],
|
| 20 |
+
"patch_size": 14,
|
| 21 |
+
"resample": 3,
|
| 22 |
+
"rescale_factor": 0.00392156862745098,
|
| 23 |
+
"size": {
|
| 24 |
+
"longest_edge": 1540
|
| 25 |
+
}
|
| 26 |
+
},
|
| 27 |
+
"patch_size": 14,
|
| 28 |
+
"processor_class": "LightOnOcrProcessor",
|
| 29 |
+
"spatial_merge_size": 2
|
| 30 |
+
}
|
tokenizer.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:76e580b3d8813bf32482aa4e67c2d63be564d792244c8768e850df3cc7000470
|
| 3 |
+
size 11422920
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_prefix_space": false,
|
| 3 |
+
"backend": "tokenizers",
|
| 4 |
+
"bos_token": null,
|
| 5 |
+
"clean_up_tokenization_spaces": false,
|
| 6 |
+
"eos_token": "<|im_end|>",
|
| 7 |
+
"errors": "replace",
|
| 8 |
+
"extra_special_tokens": [
|
| 9 |
+
"<|im_start|>",
|
| 10 |
+
"<|im_end|>",
|
| 11 |
+
"<|object_ref_start|>",
|
| 12 |
+
"<|object_ref_end|>",
|
| 13 |
+
"<|box_start|>",
|
| 14 |
+
"<|box_end|>",
|
| 15 |
+
"<|quad_start|>",
|
| 16 |
+
"<|quad_end|>",
|
| 17 |
+
"<|vision_start|>",
|
| 18 |
+
"<|vision_end|>",
|
| 19 |
+
"<|vision_pad|>",
|
| 20 |
+
"<|image_pad|>",
|
| 21 |
+
"<|video_pad|>"
|
| 22 |
+
],
|
| 23 |
+
"image_break_token": "<|vision_pad|>",
|
| 24 |
+
"image_end_token": "<|vision_end|>",
|
| 25 |
+
"image_token": "<|image_pad|>",
|
| 26 |
+
"is_local": false,
|
| 27 |
+
"max_length": null,
|
| 28 |
+
"model_max_length": 131072,
|
| 29 |
+
"model_specific_special_tokens": {},
|
| 30 |
+
"pad_to_multiple_of": null,
|
| 31 |
+
"pad_token": "<|endoftext|>",
|
| 32 |
+
"pad_token_type_id": 0,
|
| 33 |
+
"padding_side": "left",
|
| 34 |
+
"processor_class": "LightOnOcrProcessor",
|
| 35 |
+
"split_special_tokens": false,
|
| 36 |
+
"tokenizer_class": "TokenizersBackend",
|
| 37 |
+
"unk_token": null
|
| 38 |
+
}
|
training_args.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:923ea519418d5f30398917b505b231da40a912af9c7edff54ed6499aafdaafdd
|
| 3 |
+
size 5137
|