Upload folder using huggingface_hub
Browse files- README.md +4 -13
- processor_config.json +0 -10
- tokenizer.json +2 -2
- tokenizer_config.json +6 -18
README.md
CHANGED
|
@@ -1,7 +1,6 @@
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
-
|
| 4 |
-
- lightonai/LightOnOCR-2-1B
|
| 5 |
language:
|
| 6 |
- en
|
| 7 |
- fr
|
|
@@ -12,8 +11,8 @@ language:
|
|
| 12 |
- pt
|
| 13 |
- sv
|
| 14 |
- da
|
| 15 |
-
- ja
|
| 16 |
- zh
|
|
|
|
| 17 |
library_name: transformers
|
| 18 |
tags:
|
| 19 |
- ocr
|
|
@@ -23,7 +22,6 @@ tags:
|
|
| 23 |
- tables
|
| 24 |
- forms
|
| 25 |
- mlx
|
| 26 |
-
pipeline_tag: image-text-to-text
|
| 27 |
---
|
| 28 |
|
| 29 |
# mlx-community/LightOnOCR-2-1B-4bit
|
|
@@ -31,17 +29,10 @@ This model was converted to MLX format from [`lightonai/LightOnOCR-2-1B`]() usin
|
|
| 31 |
Refer to the [original model card](https://huggingface.co/lightonai/LightOnOCR-2-1B) for more details on the model.
|
| 32 |
## Use with mlx
|
| 33 |
|
| 34 |
-
> **Note:** LightOnOCR-2 requires transformers installed from source (not yet in a stable release).
|
| 35 |
-
|
| 36 |
-
```bash
|
| 37 |
-
pip install git+https://github.com/huggingface/transformers
|
| 38 |
-
pip install pillow pypdfium2
|
| 39 |
-
```
|
| 40 |
-
|
| 41 |
```bash
|
| 42 |
pip install -U mlx-vlm
|
| 43 |
```
|
| 44 |
|
| 45 |
```bash
|
| 46 |
-
python -m mlx_vlm.generate --model mlx-community/LightOnOCR-2-1B-4bit --max-tokens 100 --temperature 0.0 --prompt "" --image <path_to_image>
|
| 47 |
-
```
|
|
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
+
pipeline_tag: image-text-to-text
|
|
|
|
| 4 |
language:
|
| 5 |
- en
|
| 6 |
- fr
|
|
|
|
| 11 |
- pt
|
| 12 |
- sv
|
| 13 |
- da
|
|
|
|
| 14 |
- zh
|
| 15 |
+
- ja
|
| 16 |
library_name: transformers
|
| 17 |
tags:
|
| 18 |
- ocr
|
|
|
|
| 22 |
- tables
|
| 23 |
- forms
|
| 24 |
- mlx
|
|
|
|
| 25 |
---
|
| 26 |
|
| 27 |
# mlx-community/LightOnOCR-2-1B-4bit
|
|
|
|
| 29 |
Refer to the [original model card](https://huggingface.co/lightonai/LightOnOCR-2-1B) for more details on the model.
|
| 30 |
## Use with mlx
|
| 31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
```bash
|
| 33 |
pip install -U mlx-vlm
|
| 34 |
```
|
| 35 |
|
| 36 |
```bash
|
| 37 |
+
python -m mlx_vlm.generate --model mlx-community/LightOnOCR-2-1B-4bit --max-tokens 100 --temperature 0.0 --prompt "Describe this image." --image <path_to_image>
|
| 38 |
+
```
|
processor_config.json
CHANGED
|
@@ -2,15 +2,10 @@
|
|
| 2 |
"image_break_token": "<|vision_pad|>",
|
| 3 |
"image_end_token": "<|vision_end|>",
|
| 4 |
"image_processor": {
|
| 5 |
-
"crop_size": null,
|
| 6 |
"data_format": "channels_first",
|
| 7 |
"default_to_square": true,
|
| 8 |
-
"device": null,
|
| 9 |
-
"disable_grouping": null,
|
| 10 |
-
"do_center_crop": null,
|
| 11 |
"do_convert_rgb": true,
|
| 12 |
"do_normalize": true,
|
| 13 |
-
"do_pad": null,
|
| 14 |
"do_rescale": true,
|
| 15 |
"do_resize": true,
|
| 16 |
"image_mean": [
|
|
@@ -19,19 +14,14 @@
|
|
| 19 |
0.40821073
|
| 20 |
],
|
| 21 |
"image_processor_type": "PixtralImageProcessorFast",
|
| 22 |
-
"image_seq_length": null,
|
| 23 |
"image_std": [
|
| 24 |
0.26862954,
|
| 25 |
0.26130258,
|
| 26 |
0.27577711
|
| 27 |
],
|
| 28 |
-
"input_data_format": null,
|
| 29 |
-
"pad_size": null,
|
| 30 |
"patch_size": 14,
|
| 31 |
-
"processor_class": "PixtralProcessor",
|
| 32 |
"resample": 3,
|
| 33 |
"rescale_factor": 0.00392156862745098,
|
| 34 |
-
"return_tensors": null,
|
| 35 |
"size": {
|
| 36 |
"longest_edge": 1540
|
| 37 |
}
|
|
|
|
| 2 |
"image_break_token": "<|vision_pad|>",
|
| 3 |
"image_end_token": "<|vision_end|>",
|
| 4 |
"image_processor": {
|
|
|
|
| 5 |
"data_format": "channels_first",
|
| 6 |
"default_to_square": true,
|
|
|
|
|
|
|
|
|
|
| 7 |
"do_convert_rgb": true,
|
| 8 |
"do_normalize": true,
|
|
|
|
| 9 |
"do_rescale": true,
|
| 10 |
"do_resize": true,
|
| 11 |
"image_mean": [
|
|
|
|
| 14 |
0.40821073
|
| 15 |
],
|
| 16 |
"image_processor_type": "PixtralImageProcessorFast",
|
|
|
|
| 17 |
"image_std": [
|
| 18 |
0.26862954,
|
| 19 |
0.26130258,
|
| 20 |
0.27577711
|
| 21 |
],
|
|
|
|
|
|
|
| 22 |
"patch_size": 14,
|
|
|
|
| 23 |
"resample": 3,
|
| 24 |
"rescale_factor": 0.00392156862745098,
|
|
|
|
| 25 |
"size": {
|
| 26 |
"longest_edge": 1540
|
| 27 |
}
|
tokenizer.json
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f54b55fa0c3aba0c91ce09ea79ae4e62da24e2a1a630f96c4bae34aba25e234a
|
| 3 |
+
size 11422822
|
tokenizer_config.json
CHANGED
|
@@ -1,20 +1,5 @@
|
|
| 1 |
{
|
| 2 |
"add_prefix_space": false,
|
| 3 |
-
"additional_special_tokens": [
|
| 4 |
-
"<|im_start|>",
|
| 5 |
-
"<|im_end|>",
|
| 6 |
-
"<|object_ref_start|>",
|
| 7 |
-
"<|object_ref_end|>",
|
| 8 |
-
"<|box_start|>",
|
| 9 |
-
"<|box_end|>",
|
| 10 |
-
"<|quad_start|>",
|
| 11 |
-
"<|quad_end|>",
|
| 12 |
-
"<|vision_start|>",
|
| 13 |
-
"<|vision_end|>",
|
| 14 |
-
"<|vision_pad|>",
|
| 15 |
-
"<|image_pad|>",
|
| 16 |
-
"<|video_pad|>"
|
| 17 |
-
],
|
| 18 |
"backend": "tokenizers",
|
| 19 |
"bos_token": null,
|
| 20 |
"clean_up_tokenization_spaces": false,
|
|
@@ -39,12 +24,15 @@
|
|
| 39 |
"image_end_token": "<|vision_end|>",
|
| 40 |
"image_token": "<|image_pad|>",
|
| 41 |
"is_local": true,
|
|
|
|
| 42 |
"model_max_length": 131072,
|
| 43 |
"model_specific_special_tokens": {},
|
|
|
|
| 44 |
"pad_token": "<|endoftext|>",
|
|
|
|
|
|
|
| 45 |
"processor_class": "PixtralProcessor",
|
| 46 |
"split_special_tokens": false,
|
| 47 |
-
"tokenizer_class": "
|
| 48 |
-
"unk_token": null
|
| 49 |
-
"use_default_system_prompt": false
|
| 50 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"add_prefix_space": false,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
"backend": "tokenizers",
|
| 4 |
"bos_token": null,
|
| 5 |
"clean_up_tokenization_spaces": false,
|
|
|
|
| 24 |
"image_end_token": "<|vision_end|>",
|
| 25 |
"image_token": "<|image_pad|>",
|
| 26 |
"is_local": true,
|
| 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": "right",
|
| 34 |
"processor_class": "PixtralProcessor",
|
| 35 |
"split_special_tokens": false,
|
| 36 |
+
"tokenizer_class": "TokenizersBackend",
|
| 37 |
+
"unk_token": null
|
|
|
|
| 38 |
}
|