KiteAether commited on
Commit
de755b5
·
verified ·
1 Parent(s): 90a6fc1

Upload checkpoint

Browse files
README.md ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: transformers
3
+ license: mit
4
+ base_model: microsoft/trocr-base-handwritten
5
+ tags:
6
+ - generated_from_trainer
7
+ model-index:
8
+ - name: TEST
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
+ # TEST
16
+
17
+ This model is a fine-tuned version of [microsoft/trocr-base-handwritten](https://huggingface.co/microsoft/trocr-base-handwritten) on an unknown dataset.
18
+ It achieves the following results on the evaluation set:
19
+ - Loss: 1.1212
20
+ - Cer: 2.5281
21
+
22
+ ## Model description
23
+
24
+ More information needed
25
+
26
+ ## Intended uses & limitations
27
+
28
+ More information needed
29
+
30
+ ## Training and evaluation data
31
+
32
+ More information needed
33
+
34
+ ## Training procedure
35
+
36
+ ### Training hyperparameters
37
+
38
+ The following hyperparameters were used during training:
39
+ - learning_rate: 5e-05
40
+ - train_batch_size: 2
41
+ - eval_batch_size: 2
42
+ - seed: 42
43
+ - gradient_accumulation_steps: 2
44
+ - total_train_batch_size: 4
45
+ - optimizer: Use OptimizerNames.ADAMW_TORCH with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
46
+ - lr_scheduler_type: linear
47
+ - num_epochs: 2
48
+
49
+ ### Training results
50
+
51
+ | Training Loss | Epoch | Step | Validation Loss | Cer |
52
+ |:-------------:|:-----:|:----:|:---------------:|:------:|
53
+ | 2.1597 | 1.0 | 946 | 1.7753 | 1.9704 |
54
+ | 1.311 | 2.0 | 1892 | 1.1212 | 2.5281 |
55
+
56
+
57
+ ### Framework versions
58
+
59
+ - Transformers 4.52.4
60
+ - Pytorch 2.6.0+cu124
61
+ - Datasets 3.6.0
62
+ - Tokenizers 0.21.1
config.json ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "VisionEncoderDecoderModel"
4
+ ],
5
+ "decoder": {
6
+ "activation_dropout": 0.0,
7
+ "activation_function": "gelu",
8
+ "add_cross_attention": true,
9
+ "attention_dropout": 0.0,
10
+ "classifier_dropout": 0.0,
11
+ "cross_attention_hidden_size": 768,
12
+ "d_model": 1024,
13
+ "decoder_attention_heads": 16,
14
+ "decoder_ffn_dim": 4096,
15
+ "decoder_layerdrop": 0.0,
16
+ "decoder_layers": 12,
17
+ "dropout": 0.1,
18
+ "init_std": 0.02,
19
+ "is_decoder": true,
20
+ "layernorm_embedding": true,
21
+ "max_position_embeddings": 512,
22
+ "model_type": "trocr",
23
+ "scale_embedding": false,
24
+ "torch_dtype": "float32",
25
+ "use_cache": false,
26
+ "use_learned_position_embeddings": true,
27
+ "vocab_size": 50265
28
+ },
29
+ "decoder_start_token_id": 0,
30
+ "early_stopping": null,
31
+ "encoder": {
32
+ "attention_probs_dropout_prob": 0.0,
33
+ "encoder_stride": 16,
34
+ "hidden_act": "gelu",
35
+ "hidden_dropout_prob": 0.0,
36
+ "hidden_size": 768,
37
+ "image_size": 384,
38
+ "initializer_range": 0.02,
39
+ "intermediate_size": 3072,
40
+ "layer_norm_eps": 1e-12,
41
+ "model_type": "vit",
42
+ "num_attention_heads": 12,
43
+ "num_channels": 3,
44
+ "num_hidden_layers": 12,
45
+ "patch_size": 16,
46
+ "pooler_act": "tanh",
47
+ "pooler_output_size": 768,
48
+ "qkv_bias": false,
49
+ "torch_dtype": "float32"
50
+ },
51
+ "eos_token_id": 2,
52
+ "is_encoder_decoder": true,
53
+ "length_penalty": null,
54
+ "max_length": null,
55
+ "model_type": "vision-encoder-decoder",
56
+ "no_repeat_ngram_size": null,
57
+ "num_beams": null,
58
+ "pad_token_id": 1,
59
+ "processor_class": "TrOCRProcessor",
60
+ "tie_word_embeddings": false,
61
+ "torch_dtype": "float32",
62
+ "transformers_version": "4.52.4",
63
+ "vocab_size": 50265
64
+ }
generation_config.json ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token_id": 0,
3
+ "decoder_start_token_id": 0,
4
+ "early_stopping": true,
5
+ "eos_token_id": 2,
6
+ "length_penalty": 2.0,
7
+ "max_length": 64,
8
+ "no_repeat_ngram_size": 3,
9
+ "num_beams": 4,
10
+ "pad_token_id": 1,
11
+ "transformers_version": "4.52.4",
12
+ "use_cache": false
13
+ }
merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b95fd103e9ba2a64bd28745fdfc808c15f57b072841e6397c992f50069ea152f
3
+ size 1335747032
preprocessor_config.json ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "do_convert_rgb": null,
3
+ "do_normalize": true,
4
+ "do_rescale": true,
5
+ "do_resize": true,
6
+ "image_mean": [
7
+ 0.5,
8
+ 0.5,
9
+ 0.5
10
+ ],
11
+ "image_processor_type": "ViTImageProcessor",
12
+ "image_std": [
13
+ 0.5,
14
+ 0.5,
15
+ 0.5
16
+ ],
17
+ "processor_class": "TrOCRProcessor",
18
+ "resample": 2,
19
+ "rescale_factor": 0.00392156862745098,
20
+ "size": {
21
+ "height": 384,
22
+ "width": 384
23
+ }
24
+ }
special_tokens_map.json ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "<s>",
4
+ "lstrip": false,
5
+ "normalized": true,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "cls_token": {
10
+ "content": "<s>",
11
+ "lstrip": false,
12
+ "normalized": true,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "eos_token": {
17
+ "content": "</s>",
18
+ "lstrip": false,
19
+ "normalized": true,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ },
23
+ "mask_token": {
24
+ "content": "<mask>",
25
+ "lstrip": true,
26
+ "normalized": true,
27
+ "rstrip": false,
28
+ "single_word": false
29
+ },
30
+ "pad_token": {
31
+ "content": "<pad>",
32
+ "lstrip": false,
33
+ "normalized": true,
34
+ "rstrip": false,
35
+ "single_word": false
36
+ },
37
+ "sep_token": {
38
+ "content": "</s>",
39
+ "lstrip": false,
40
+ "normalized": true,
41
+ "rstrip": false,
42
+ "single_word": false
43
+ },
44
+ "unk_token": {
45
+ "content": "<unk>",
46
+ "lstrip": false,
47
+ "normalized": true,
48
+ "rstrip": false,
49
+ "single_word": false
50
+ }
51
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "added_tokens_decoder": {
4
+ "0": {
5
+ "content": "<s>",
6
+ "lstrip": false,
7
+ "normalized": true,
8
+ "rstrip": false,
9
+ "single_word": false,
10
+ "special": true
11
+ },
12
+ "1": {
13
+ "content": "<pad>",
14
+ "lstrip": false,
15
+ "normalized": true,
16
+ "rstrip": false,
17
+ "single_word": false,
18
+ "special": true
19
+ },
20
+ "2": {
21
+ "content": "</s>",
22
+ "lstrip": false,
23
+ "normalized": true,
24
+ "rstrip": false,
25
+ "single_word": false,
26
+ "special": true
27
+ },
28
+ "3": {
29
+ "content": "<unk>",
30
+ "lstrip": false,
31
+ "normalized": true,
32
+ "rstrip": false,
33
+ "single_word": false,
34
+ "special": true
35
+ },
36
+ "50264": {
37
+ "content": "<mask>",
38
+ "lstrip": true,
39
+ "normalized": true,
40
+ "rstrip": false,
41
+ "single_word": false,
42
+ "special": true
43
+ }
44
+ },
45
+ "bos_token": "<s>",
46
+ "clean_up_tokenization_spaces": false,
47
+ "cls_token": "<s>",
48
+ "eos_token": "</s>",
49
+ "errors": "replace",
50
+ "extra_special_tokens": {},
51
+ "mask_token": "<mask>",
52
+ "model_max_length": 512,
53
+ "pad_token": "<pad>",
54
+ "processor_class": "TrOCRProcessor",
55
+ "sep_token": "</s>",
56
+ "tokenizer_class": "RobertaTokenizer",
57
+ "trim_offsets": true,
58
+ "unk_token": "<unk>"
59
+ }
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f780b0df1c2ca86781df2a55f77c03e043da9af36e5e156196516da7c4c0c362
3
+ size 5368
vocab.json ADDED
The diff for this file is too large to render. See raw diff