muhammadummerrr commited on
Commit
2669cac
·
verified ·
1 Parent(s): 19d1105

Upload LoRA adapter with valid metadata

Browse files
README.md ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: en
3
+ base_model: Bennet1996/donut-small
4
+ tags:
5
+ - lora
6
+ - donut
7
+ - receipt-extraction
8
+ library_name: peft
9
+ license: apache-2.0
10
+ datasets:
11
+ - receipt-dataset
12
+ pipeline_tag: document-question-answering
13
+ ---
14
+
15
+ # Donut Receipt LoRA Adapter 🧾
16
+
17
+ This is a **LoRA adapter** fine-tuned on `Bennet1996/donut-small` for receipt key information extraction.
18
+
19
+ **Extracts:**
20
+ - `company`
21
+ - `date` (any format: `DD/MM/YYYY`, `DD-MM-YYYY`, etc.)
22
+ - `address`
23
+ - `total`
24
+
25
+ You can attach this adapter to the base Donut model like:
26
+ ```python
27
+ from peft import PeftModel
28
+ from transformers import VisionEncoderDecoderModel
29
+ base = VisionEncoderDecoderModel.from_pretrained("Bennet1996/donut-small")
30
+ model = PeftModel.from_pretrained(base, "YOUR_USERNAME/donut-receipt-lora-finetuned-adapter")
adapter_config.json ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "alpha_pattern": {},
3
+ "auto_mapping": null,
4
+ "base_model_name_or_path": "",
5
+ "bias": "none",
6
+ "fan_in_fan_out": false,
7
+ "inference_mode": true,
8
+ "init_lora_weights": true,
9
+ "layer_replication": null,
10
+ "layers_pattern": null,
11
+ "layers_to_transform": null,
12
+ "loftq_config": {},
13
+ "lora_alpha": 32,
14
+ "lora_dropout": 0.05,
15
+ "megatron_config": null,
16
+ "megatron_core": "megatron.core",
17
+ "modules_to_save": null,
18
+ "peft_type": "LORA",
19
+ "r": 16,
20
+ "rank_pattern": {},
21
+ "revision": null,
22
+ "target_modules": [
23
+ "fc2",
24
+ "q_proj",
25
+ "fc1",
26
+ "out_proj",
27
+ "k_proj",
28
+ "v_proj"
29
+ ],
30
+ "task_type": "CAUSAL_LM",
31
+ "use_dora": false,
32
+ "use_rslora": false
33
+ }
adapter_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1829efbb5f238d8c245c2808596a5eb162c4871b8c82025637a30da41b70dd72
3
+ size 6826880
added_tokens.json ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "</s_Brutto>": 57536,
3
+ "</s_Geburtsdatum>": 57526,
4
+ "</s_Gesamt-Brutto>": 57544,
5
+ "</s_Gesamtbrutto (EBeschV)>": 57546,
6
+ "</s_Gesamtbrutto>": 57550,
7
+ "</s_Gesetzl. Netto (EBeschV)>": 57548,
8
+ "</s_Gesetzl. Netto>": 57552,
9
+ "</s_Name>": 57534,
10
+ "</s_Netto-Verdienst>": 57542,
11
+ "</s_Netto>": 57532,
12
+ "</s_Stadt>": 57530,
13
+ "</s_Stpfl. Brutto>": 57538,
14
+ "</s_Straße>": 57528,
15
+ "</s_Summe Nettobez\\u00fcge>": 57540,
16
+ "<s_Brutto>": 57535,
17
+ "<s_Geburtsdatum>": 57525,
18
+ "<s_Gesamt-Brutto>": 57543,
19
+ "<s_Gesamtbrutto (EBeschV)>": 57545,
20
+ "<s_Gesamtbrutto>": 57549,
21
+ "<s_Gesetzl. Netto (EBeschV)>": 57547,
22
+ "<s_Gesetzl. Netto>": 57551,
23
+ "<s_Name>": 57533,
24
+ "<s_Netto-Verdienst>": 57541,
25
+ "<s_Netto>": 57531,
26
+ "<s_Stadt>": 57529,
27
+ "<s_Stpfl. Brutto>": 57537,
28
+ "<s_Straße>": 57527,
29
+ "<s_Summe Nettobez\\u00fcge>": 57539,
30
+ "<s_iitcdip>": 57523,
31
+ "<s_receipt>": 57553,
32
+ "<s_synthdog>": 57524,
33
+ "<sep/>": 57522
34
+ }
preprocessor_config.json ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "do_align_long_axis": false,
3
+ "do_normalize": true,
4
+ "do_pad": true,
5
+ "do_rescale": true,
6
+ "do_resize": true,
7
+ "do_thumbnail": true,
8
+ "image_mean": [
9
+ 0.5,
10
+ 0.5,
11
+ 0.5
12
+ ],
13
+ "image_processor_type": "DonutImageProcessor",
14
+ "image_std": [
15
+ 0.5,
16
+ 0.5,
17
+ 0.5
18
+ ],
19
+ "processor_class": "DonutProcessor",
20
+ "resample": 2,
21
+ "rescale_factor": 0.00392156862745098,
22
+ "size": {
23
+ "height": 960,
24
+ "width": 720
25
+ }
26
+ }
sentencepiece.bpe.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cb9e3dce4c326195d08fc3dd0f7e2eee1da8595c847bf4c1a9c78b7a82d47e2d
3
+ size 1296245
special_tokens_map.json ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ "<s_Geburtsdatum>",
4
+ "</s_Geburtsdatum>",
5
+ "<s_Straße>",
6
+ "</s_Straße>",
7
+ "<s_Stadt>",
8
+ "</s_Stadt>",
9
+ "<s_Name>",
10
+ "</s_Name>",
11
+ "<s_Stpfl. Brutto>",
12
+ "</s_Stpfl. Brutto>",
13
+ "<s_Summe Nettobez\\u00fcge>",
14
+ "</s_Summe Nettobez\\u00fcge>",
15
+ "<s_Netto-Verdienst>",
16
+ "</s_Netto-Verdienst>",
17
+ "<s_Gesamt-Brutto>",
18
+ "</s_Gesamt-Brutto>",
19
+ "<s_Gesamtbrutto>",
20
+ "</s_Gesamtbrutto>",
21
+ "<s_Gesetzl. Netto>",
22
+ "</s_Gesetzl. Netto>",
23
+ "<s>",
24
+ "</s>"
25
+ ],
26
+ "bos_token": {
27
+ "content": "<s>",
28
+ "lstrip": false,
29
+ "normalized": false,
30
+ "rstrip": false,
31
+ "single_word": false
32
+ },
33
+ "cls_token": {
34
+ "content": "<s>",
35
+ "lstrip": false,
36
+ "normalized": false,
37
+ "rstrip": false,
38
+ "single_word": false
39
+ },
40
+ "eos_token": {
41
+ "content": "</s>",
42
+ "lstrip": false,
43
+ "normalized": false,
44
+ "rstrip": false,
45
+ "single_word": false
46
+ },
47
+ "mask_token": {
48
+ "content": "<mask>",
49
+ "lstrip": true,
50
+ "normalized": true,
51
+ "rstrip": false,
52
+ "single_word": false
53
+ },
54
+ "pad_token": "<pad>",
55
+ "sep_token": {
56
+ "content": "</s>",
57
+ "lstrip": false,
58
+ "normalized": false,
59
+ "rstrip": false,
60
+ "single_word": false
61
+ },
62
+ "unk_token": {
63
+ "content": "<unk>",
64
+ "lstrip": false,
65
+ "normalized": false,
66
+ "rstrip": false,
67
+ "single_word": false
68
+ }
69
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,343 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "0": {
4
+ "content": "<s>",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false,
9
+ "special": true
10
+ },
11
+ "1": {
12
+ "content": "<pad>",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "2": {
20
+ "content": "</s>",
21
+ "lstrip": false,
22
+ "normalized": true,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": false
26
+ },
27
+ "3": {
28
+ "content": "<unk>",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "57521": {
36
+ "content": "<mask>",
37
+ "lstrip": true,
38
+ "normalized": true,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ },
43
+ "57522": {
44
+ "content": "<sep/>",
45
+ "lstrip": false,
46
+ "normalized": true,
47
+ "rstrip": false,
48
+ "single_word": false,
49
+ "special": false
50
+ },
51
+ "57523": {
52
+ "content": "<s_iitcdip>",
53
+ "lstrip": false,
54
+ "normalized": true,
55
+ "rstrip": false,
56
+ "single_word": false,
57
+ "special": false
58
+ },
59
+ "57524": {
60
+ "content": "<s_synthdog>",
61
+ "lstrip": false,
62
+ "normalized": true,
63
+ "rstrip": false,
64
+ "single_word": false,
65
+ "special": false
66
+ },
67
+ "57525": {
68
+ "content": "<s_Geburtsdatum>",
69
+ "lstrip": false,
70
+ "normalized": false,
71
+ "rstrip": false,
72
+ "single_word": false,
73
+ "special": true
74
+ },
75
+ "57526": {
76
+ "content": "</s_Geburtsdatum>",
77
+ "lstrip": false,
78
+ "normalized": false,
79
+ "rstrip": false,
80
+ "single_word": false,
81
+ "special": true
82
+ },
83
+ "57527": {
84
+ "content": "<s_Straße>",
85
+ "lstrip": false,
86
+ "normalized": false,
87
+ "rstrip": false,
88
+ "single_word": false,
89
+ "special": true
90
+ },
91
+ "57528": {
92
+ "content": "</s_Straße>",
93
+ "lstrip": false,
94
+ "normalized": false,
95
+ "rstrip": false,
96
+ "single_word": false,
97
+ "special": true
98
+ },
99
+ "57529": {
100
+ "content": "<s_Stadt>",
101
+ "lstrip": false,
102
+ "normalized": false,
103
+ "rstrip": false,
104
+ "single_word": false,
105
+ "special": true
106
+ },
107
+ "57530": {
108
+ "content": "</s_Stadt>",
109
+ "lstrip": false,
110
+ "normalized": false,
111
+ "rstrip": false,
112
+ "single_word": false,
113
+ "special": true
114
+ },
115
+ "57531": {
116
+ "content": "<s_Netto>",
117
+ "lstrip": false,
118
+ "normalized": true,
119
+ "rstrip": false,
120
+ "single_word": false,
121
+ "special": false
122
+ },
123
+ "57532": {
124
+ "content": "</s_Netto>",
125
+ "lstrip": false,
126
+ "normalized": true,
127
+ "rstrip": false,
128
+ "single_word": false,
129
+ "special": false
130
+ },
131
+ "57533": {
132
+ "content": "<s_Name>",
133
+ "lstrip": false,
134
+ "normalized": false,
135
+ "rstrip": false,
136
+ "single_word": false,
137
+ "special": true
138
+ },
139
+ "57534": {
140
+ "content": "</s_Name>",
141
+ "lstrip": false,
142
+ "normalized": false,
143
+ "rstrip": false,
144
+ "single_word": false,
145
+ "special": true
146
+ },
147
+ "57535": {
148
+ "content": "<s_Brutto>",
149
+ "lstrip": false,
150
+ "normalized": true,
151
+ "rstrip": false,
152
+ "single_word": false,
153
+ "special": false
154
+ },
155
+ "57536": {
156
+ "content": "</s_Brutto>",
157
+ "lstrip": false,
158
+ "normalized": true,
159
+ "rstrip": false,
160
+ "single_word": false,
161
+ "special": false
162
+ },
163
+ "57537": {
164
+ "content": "<s_Stpfl. Brutto>",
165
+ "lstrip": false,
166
+ "normalized": false,
167
+ "rstrip": false,
168
+ "single_word": false,
169
+ "special": true
170
+ },
171
+ "57538": {
172
+ "content": "</s_Stpfl. Brutto>",
173
+ "lstrip": false,
174
+ "normalized": false,
175
+ "rstrip": false,
176
+ "single_word": false,
177
+ "special": true
178
+ },
179
+ "57539": {
180
+ "content": "<s_Summe Nettobez\\u00fcge>",
181
+ "lstrip": false,
182
+ "normalized": false,
183
+ "rstrip": false,
184
+ "single_word": false,
185
+ "special": true
186
+ },
187
+ "57540": {
188
+ "content": "</s_Summe Nettobez\\u00fcge>",
189
+ "lstrip": false,
190
+ "normalized": false,
191
+ "rstrip": false,
192
+ "single_word": false,
193
+ "special": true
194
+ },
195
+ "57541": {
196
+ "content": "<s_Netto-Verdienst>",
197
+ "lstrip": false,
198
+ "normalized": false,
199
+ "rstrip": false,
200
+ "single_word": false,
201
+ "special": true
202
+ },
203
+ "57542": {
204
+ "content": "</s_Netto-Verdienst>",
205
+ "lstrip": false,
206
+ "normalized": false,
207
+ "rstrip": false,
208
+ "single_word": false,
209
+ "special": true
210
+ },
211
+ "57543": {
212
+ "content": "<s_Gesamt-Brutto>",
213
+ "lstrip": false,
214
+ "normalized": false,
215
+ "rstrip": false,
216
+ "single_word": false,
217
+ "special": true
218
+ },
219
+ "57544": {
220
+ "content": "</s_Gesamt-Brutto>",
221
+ "lstrip": false,
222
+ "normalized": false,
223
+ "rstrip": false,
224
+ "single_word": false,
225
+ "special": true
226
+ },
227
+ "57545": {
228
+ "content": "<s_Gesamtbrutto (EBeschV)>",
229
+ "lstrip": false,
230
+ "normalized": false,
231
+ "rstrip": false,
232
+ "single_word": false,
233
+ "special": true
234
+ },
235
+ "57546": {
236
+ "content": "</s_Gesamtbrutto (EBeschV)>",
237
+ "lstrip": false,
238
+ "normalized": false,
239
+ "rstrip": false,
240
+ "single_word": false,
241
+ "special": true
242
+ },
243
+ "57547": {
244
+ "content": "<s_Gesetzl. Netto (EBeschV)>",
245
+ "lstrip": false,
246
+ "normalized": false,
247
+ "rstrip": false,
248
+ "single_word": false,
249
+ "special": true
250
+ },
251
+ "57548": {
252
+ "content": "</s_Gesetzl. Netto (EBeschV)>",
253
+ "lstrip": false,
254
+ "normalized": false,
255
+ "rstrip": false,
256
+ "single_word": false,
257
+ "special": true
258
+ },
259
+ "57549": {
260
+ "content": "<s_Gesamtbrutto>",
261
+ "lstrip": false,
262
+ "normalized": false,
263
+ "rstrip": false,
264
+ "single_word": false,
265
+ "special": true
266
+ },
267
+ "57550": {
268
+ "content": "</s_Gesamtbrutto>",
269
+ "lstrip": false,
270
+ "normalized": false,
271
+ "rstrip": false,
272
+ "single_word": false,
273
+ "special": true
274
+ },
275
+ "57551": {
276
+ "content": "<s_Gesetzl. Netto>",
277
+ "lstrip": false,
278
+ "normalized": false,
279
+ "rstrip": false,
280
+ "single_word": false,
281
+ "special": true
282
+ },
283
+ "57552": {
284
+ "content": "</s_Gesetzl. Netto>",
285
+ "lstrip": false,
286
+ "normalized": false,
287
+ "rstrip": false,
288
+ "single_word": false,
289
+ "special": true
290
+ },
291
+ "57553": {
292
+ "content": "<s_receipt>",
293
+ "lstrip": false,
294
+ "normalized": true,
295
+ "rstrip": false,
296
+ "single_word": false,
297
+ "special": false
298
+ }
299
+ },
300
+ "additional_special_tokens": [
301
+ "<s_Geburtsdatum>",
302
+ "</s_Geburtsdatum>",
303
+ "<s_Straße>",
304
+ "</s_Straße>",
305
+ "<s_Stadt>",
306
+ "</s_Stadt>",
307
+ "<s_Name>",
308
+ "</s_Name>",
309
+ "<s_Stpfl. Brutto>",
310
+ "</s_Stpfl. Brutto>",
311
+ "<s_Summe Nettobez\\u00fcge>",
312
+ "</s_Summe Nettobez\\u00fcge>",
313
+ "<s_Netto-Verdienst>",
314
+ "</s_Netto-Verdienst>",
315
+ "<s_Gesamt-Brutto>",
316
+ "</s_Gesamt-Brutto>",
317
+ "<s_Gesamtbrutto>",
318
+ "</s_Gesamtbrutto>",
319
+ "<s_Gesetzl. Netto>",
320
+ "</s_Gesetzl. Netto>",
321
+ "<s>",
322
+ "</s>"
323
+ ],
324
+ "bos_token": "<s>",
325
+ "clean_up_tokenization_spaces": true,
326
+ "cls_token": "<s>",
327
+ "eos_token": "</s>",
328
+ "mask_token": "<mask>",
329
+ "max_length": 512,
330
+ "model_max_length": 1000000000000000019884624838656,
331
+ "pad_to_multiple_of": null,
332
+ "pad_token": "<pad>",
333
+ "pad_token_type_id": 0,
334
+ "padding_side": "right",
335
+ "processor_class": "DonutProcessor",
336
+ "sep_token": "</s>",
337
+ "sp_model_kwargs": {},
338
+ "stride": 0,
339
+ "tokenizer_class": "XLMRobertaTokenizer",
340
+ "truncation_side": "right",
341
+ "truncation_strategy": "longest_first",
342
+ "unk_token": "<unk>"
343
+ }