Mungert commited on
Commit
f8ccb52
Β·
verified Β·
0 Parent(s):

Super-squash history to reclaim storage

Browse files
.gitattributes ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz 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
+ Nanonets-OCR-s-f16.gguf filter=lfs diff=lfs merge=lfs -text
37
+ Nanonets-OCR-s-f16_q8_0.gguf filter=lfs diff=lfs merge=lfs -text
38
+ Nanonets-OCR-s-bf16_q8_0.gguf filter=lfs diff=lfs merge=lfs -text
39
+ Nanonets-OCR-s-f16_q6_k.gguf filter=lfs diff=lfs merge=lfs -text
40
+ Nanonets-OCR-s-bf16_q6_k.gguf filter=lfs diff=lfs merge=lfs -text
41
+ Nanonets-OCR-s-f16_q4_k.gguf filter=lfs diff=lfs merge=lfs -text
42
+ Nanonets-OCR-s-bf16_q4_k.gguf filter=lfs diff=lfs merge=lfs -text
43
+ Nanonets-OCR-s-q5_k_m.gguf filter=lfs diff=lfs merge=lfs -text
44
+ Nanonets-OCR-s-q5_k_s.gguf filter=lfs diff=lfs merge=lfs -text
45
+ Nanonets-OCR-s-q6_k_m.gguf filter=lfs diff=lfs merge=lfs -text
46
+ Nanonets-OCR-s-q8_0.gguf filter=lfs diff=lfs merge=lfs -text
47
+ Nanonets-OCR-s-q4_0.gguf filter=lfs diff=lfs merge=lfs -text
48
+ Nanonets-OCR-s-q4_1.gguf filter=lfs diff=lfs merge=lfs -text
49
+ Nanonets-OCR-s-q4_0_l.gguf filter=lfs diff=lfs merge=lfs -text
50
+ Nanonets-OCR-s-q5_0.gguf filter=lfs diff=lfs merge=lfs -text
51
+ Nanonets-OCR-s-q5_1.gguf filter=lfs diff=lfs merge=lfs -text
52
+ Nanonets-OCR-s-q5_0_l.gguf filter=lfs diff=lfs merge=lfs -text
53
+ Nanonets-OCR-s-q5_1_l.gguf filter=lfs diff=lfs merge=lfs -text
54
+ Nanonets-OCR-s-iq1_s.gguf filter=lfs diff=lfs merge=lfs -text
55
+ Nanonets-OCR-s-iq1_m.gguf filter=lfs diff=lfs merge=lfs -text
56
+ Nanonets-OCR-s-iq2_xs.gguf filter=lfs diff=lfs merge=lfs -text
57
+ Nanonets-OCR-s-iq2_xxs.gguf filter=lfs diff=lfs merge=lfs -text
58
+ Nanonets-OCR-s-iq2_s.gguf filter=lfs diff=lfs merge=lfs -text
59
+ Nanonets-OCR-s-iq2_m.gguf filter=lfs diff=lfs merge=lfs -text
60
+ Nanonets-OCR-s-iq3_xs.gguf filter=lfs diff=lfs merge=lfs -text
61
+ Nanonets-OCR-s-iq3_xxs.gguf filter=lfs diff=lfs merge=lfs -text
62
+ Nanonets-OCR-s-iq3_s.gguf filter=lfs diff=lfs merge=lfs -text
63
+ Nanonets-OCR-s-iq3_m.gguf filter=lfs diff=lfs merge=lfs -text
64
+ Nanonets-OCR-s-iq4_xs.gguf filter=lfs diff=lfs merge=lfs -text
65
+ Nanonets-OCR-s-iq4_nl.gguf filter=lfs diff=lfs merge=lfs -text
66
+ Nanonets-OCR-s-tq1_0.gguf filter=lfs diff=lfs merge=lfs -text
67
+ Nanonets-OCR-s-tq2_0.gguf filter=lfs diff=lfs merge=lfs -text
68
+ Nanonets-OCR-s.imatrix filter=lfs diff=lfs merge=lfs -text
69
+ Nanonets-OCR-s-q2_k_m.gguf filter=lfs diff=lfs merge=lfs -text
70
+ Nanonets-OCR-s-q2_k_s.gguf filter=lfs diff=lfs merge=lfs -text
71
+ Nanonets-OCR-s-bf16.mmproj filter=lfs diff=lfs merge=lfs -text
72
+ Nanonets-OCR-s-q3_k_l.gguf filter=lfs diff=lfs merge=lfs -text
73
+ Nanonets-OCR-s-q4_k_l.gguf filter=lfs diff=lfs merge=lfs -text
74
+ Nanonets-OCR-s-q4_1_l.gguf filter=lfs diff=lfs merge=lfs -text
75
+ Nanonets-OCR-s-f16.mmproj filter=lfs diff=lfs merge=lfs -text
76
+ Nanonets-OCR-s-q5_k_l.gguf filter=lfs diff=lfs merge=lfs -text
77
+ Nanonets-OCR-s-bf16.gguf filter=lfs diff=lfs merge=lfs -text
78
+ Nanonets-OCR-s-f32.mmproj filter=lfs diff=lfs merge=lfs -text
79
+ Nanonets-OCR-s-q2_k_l.gguf filter=lfs diff=lfs merge=lfs -text
80
+ Nanonets-OCR-s-q3_k_s.gguf filter=lfs diff=lfs merge=lfs -text
81
+ Nanonets-OCR-s-q4_k_m.gguf filter=lfs diff=lfs merge=lfs -text
82
+ Nanonets-OCR-s-q3_k_m.gguf filter=lfs diff=lfs merge=lfs -text
83
+ Nanonets-OCR-s-q8_0.mmproj filter=lfs diff=lfs merge=lfs -text
84
+ Nanonets-OCR-s-q4_k_s.gguf filter=lfs diff=lfs merge=lfs -text
85
+ Nanonets-OCR-s-q6_k_l.gguf filter=lfs diff=lfs merge=lfs -text
Nanonets-OCR-s-bf16.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ef54e4d185cec22be980a885367330e0fe590dfdb19a906c207afbdee7626c57
3
+ size 6178315808
Nanonets-OCR-s-bf16.mmproj ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8bfb2ba0dc6f8931c3efcbd39cc06aea05102384f0af3292bf1a8858dce39687
3
+ size 1338428512
Nanonets-OCR-s-bf16_q8_0.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5e9bb3c5aa467ed00b4a38f747641da56cebdc6e4ccbd2ec6bbd47e06223c40b
3
+ size 4497317408
Nanonets-OCR-s-f16.mmproj ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:686187fdf5e290af20da64ffb4352a1b988a1d570fa75c1c52751d2cf0a1a62b
3
+ size 1338428512
Nanonets-OCR-s-f16_q8_0.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d133719928673c4e2a46fa34dc1e80159fb5a6319d56bbed878fdd84659980f8
3
+ size 4497317408
Nanonets-OCR-s-f32.mmproj ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2b292f1dee515b71a931115d7eb7c9f19c39463b131ca114b4ff705b481c83ff
3
+ size 2671758432
Nanonets-OCR-s-iq1_m.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0516c84a7f9d5f996095c6c5b72c1c6b5a03068c345a6badbdc91e3f7a986721
3
+ size 997302112
Nanonets-OCR-s-iq1_s.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5348375e315a9064526913f4fbbc9eb4743bbc63efa2cf02746224f17df3ae11
3
+ size 925179744
Nanonets-OCR-s-iq2_m.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:30842d79efae301996e766241189bdb4c1e6f560cd561350c06f548403f45a1f
3
+ size 1199726432
Nanonets-OCR-s-iq2_s.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:38407734740af334e45c3927e6de07cacb082553eccd9de828450cd0ed90e146
3
+ size 1146052448
Nanonets-OCR-s-iq2_xs.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:08ba6ef9c770e88a67cca28164a659fad11db09901c93d6697e0bc9c1aaa689a
3
+ size 1111433056
Nanonets-OCR-s-iq2_xxs.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5e3eea75723bc0e2ad9831db52bd84ce1dacdae635be7c955d2ab6f17b370137
3
+ size 1026629472
Nanonets-OCR-s-iq3_m.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ed03cad207681497d7fa203adae1bdc59dd2db4ee12bf374427bd78902d94570
3
+ size 1523654496
Nanonets-OCR-s-iq3_s.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3e0f1fdd06622a8e88fa5b96f090cdcdda8fc0aad9b233fb3c8a3abb94bfcc94
3
+ size 1507008352
Nanonets-OCR-s-iq3_xs.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5c0afa262f0656e5ccb78a96e397c23bd110de827baa7dd92c6f24f3ddf1c376
3
+ size 1368825696
Nanonets-OCR-s-iq3_xxs.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3318333dc59747018f85ae4e12f9d6e66994490aab5df38100e319da72152d8a
3
+ size 1339187040
Nanonets-OCR-s-iq4_nl.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:28ab12fab96d7b1e563ea67944154bc632a5ac34c9c939791e017e6e22869246
3
+ size 1825208160
Nanonets-OCR-s-iq4_xs.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0ecf62308db8fa6fed2ae540626c9b74c22a148959e14b9bf1ecc150e8ac6f9c
3
+ size 1739093856
Nanonets-OCR-s-q2_k_m.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:714b43a691cbd8f7ada07552a30216da2e7bedcba68282060e499872711d3e63
3
+ size 1274754912
Nanonets-OCR-s-q2_k_s.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3a2a3a955c64f2ffb757130773dd173f887da9a95e75db1fd9ad43d9acb33474
3
+ size 1233477472
Nanonets-OCR-s-q3_k_m.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8e03facfb94c3f3f19462db72c0cf7b54fe74f08c1c7dc5aff072fe905a97f72
3
+ size 1590474592
Nanonets-OCR-s-q3_k_s.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:af8a2338bab44685fc203331890a872be1d1479775e084606e59d72d16b2ad3a
3
+ size 1539710816
Nanonets-OCR-s-q4_0.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:01cf2b2844257c760152e9f2fc0267d11b7b4479b920f17e195e58c9cb143d0c
3
+ size 1742626656
Nanonets-OCR-s-q4_1.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:30775f206c5ebaf39bc5c4e1cbc1f3373af86a373a9a69ba6510da43a56cf7da
3
+ size 1935482720
Nanonets-OCR-s-q4_k_m.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9d762a6a86bfe5494c700e4ce95bad9b7f681bb639f3007d0174070599e35bf2
3
+ size 1934096224
Nanonets-OCR-s-q4_k_s.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:11d476a9ef2b494729dbcda39b786ab7d3c5febccef7eaf615578b98298ffd9f
3
+ size 1850111840
Nanonets-OCR-s-q5_0.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6b67296fb2153e8ae365d2fc6262e4182b6456deb60384d444ba7230977a7841
3
+ size 2128338784
Nanonets-OCR-s-q5_1.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1ce3a7797a3287be1f710a70d90fc977d76465134f61fcbe2851c71d921a1564
3
+ size 2321194848
Nanonets-OCR-s-q5_k_m.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6a10d3a615f6ce20873516d69402a1f1ab3202bbbd0b1ff2e3d186152326cade
3
+ size 2229270368
Nanonets-OCR-s-q5_k_s.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6c16fbda4e52b43964e51e0d434ffa6fa7ef181829403f51b4be45a9a003b72b
3
+ size 2198632288
Nanonets-OCR-s-q6_k_m.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d6f23021dcd10a6a9223d05399df22182c7fc7c96608e68cb1c1ed0d9cfc9f71
3
+ size 2538157920
Nanonets-OCR-s-q8_0.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b06e05871bcbce64e1345e55dff9258fde0285d7138802b97af7102e94910cdb
3
+ size 3285474848
Nanonets-OCR-s-q8_0.mmproj ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5148d8ff54b32ff6c144ff6e2e3343437bba996b4fec14a3e9d7c4a292d0224e
3
+ size 844758112
Nanonets-OCR-s-tq1_0.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:eefc4e9d1d1192a4e3257dfd1a3ee22eaa012b0442055bee21b8cc3b4b4daa8d
3
+ size 847427424
Nanonets-OCR-s-tq2_0.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cd004b2f07030a446fc27d5cddc216299d8a7677cf72dca1e48bcbd4800de9b9
3
+ size 977483616
Nanonets-OCR-s.imatrix ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:91e50bf9ebfcb0e6ab67e45790a23c5358a34be002786407140e8d2b8567289f
3
+ size 3363024
README.md ADDED
@@ -0,0 +1,233 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ base_model:
5
+ - Qwen/Qwen2.5-VL-3B-Instruct
6
+ pipeline_tag: image-text-to-text
7
+ tags:
8
+ - OCR
9
+ - pdf2markdown
10
+ library_name: transformers
11
+ ---
12
+
13
+ # <span style="color: #7FFF7F;">Nanonets-OCR-s GGUF Models</span>
14
+
15
+
16
+ ## <span style="color: #7F7FFF;">Model Generation Details</span>
17
+
18
+ This model was generated using [llama.cpp](https://github.com/ggerganov/llama.cpp) at commit [`bf9087f5`](https://github.com/ggerganov/llama.cpp/commit/bf9087f59aab940cf312b85a67067ce33d9e365a).
19
+
20
+
21
+
22
+
23
+
24
+ ---
25
+
26
+ ## <span style="color: #7FFF7F;">Quantization Beyond the IMatrix</span>
27
+
28
+ I've been experimenting with a new quantization approach that selectively elevates the precision of key layers beyond what the default IMatrix configuration provides.
29
+
30
+ In my testing, standard IMatrix quantization underperforms at lower bit depths, especially with Mixture of Experts (MoE) models. To address this, I'm using the `--tensor-type` option in `llama.cpp` to manually "bump" important layers to higher precision. You can see the implementation here:
31
+ πŸ‘‰ [Layer bumping with llama.cpp](https://github.com/Mungert69/GGUFModelBuilder/blob/main/model-converter/tensor_list_builder.py)
32
+
33
+ While this does increase model file size, it significantly improves precision for a given quantization level.
34
+
35
+ ### **I'd love your feedbackβ€”have you tried this? How does it perform for you?**
36
+
37
+
38
+
39
+
40
+ ---
41
+
42
+ <a href="https://readyforquantum.com/huggingface_gguf_selection_guide.html" style="color: #7FFF7F;">
43
+ Click here to get info on choosing the right GGUF model format
44
+ </a>
45
+
46
+ ---
47
+
48
+
49
+
50
+ <!--Begin Original Model Card-->
51
+
52
+
53
+
54
+ Nanonets-OCR-s by [Nanonets](https://nanonets.com) is a powerful, state-of-the-art image-to-markdown OCR model that goes far beyond traditional text extraction. It transforms documents into structured markdown with intelligent content recognition and semantic tagging, making it ideal for downstream processing by Large Language Models (LLMs).
55
+
56
+ Nanonets-OCR-s is packed with features designed to handle complex documents with ease:
57
+
58
+ * **LaTeX Equation Recognition:** Automatically converts mathematical equations and formulas into properly formatted LaTeX syntax. It distinguishes between inline (`$...$`) and display (`$$...$$`) equations.
59
+ * **Intelligent Image Description:** Describes images within documents using structured `<img>` tags, making them digestible for LLM processing. It can describe various image types, including logos, charts, graphs and so on, detailing their content, style, and context.
60
+ * **Signature Detection & Isolation:** Identifies and isolates signatures from other text, outputting them within a `<signature>` tag. This is crucial for processing legal and business documents.
61
+ * **Watermark Extraction:** Detects and extracts watermark text from documents, placing it within a `<watermark>` tag.
62
+ * **Smart Checkbox Handling:** Converts form checkboxes and radio buttons into standardized Unicode symbols (`☐`, `β˜‘`, `β˜’`) for consistent and reliable processing.
63
+ * **Complex Table Extraction:** Accurately extracts complex tables from documents and converts them into both markdown and HTML table formats.
64
+
65
+
66
+ πŸ“’ [Read the full announcement](https://nanonets.com/research/nanonets-ocr-s) | πŸ€— [Hugging Face Space Demo](https://huggingface.co/spaces/Souvik3333/Nanonets-ocr-s)
67
+
68
+ ## Usage
69
+ ### Using transformers
70
+ ```python
71
+ from PIL import Image
72
+ from transformers import AutoTokenizer, AutoProcessor, AutoModelForImageTextToText
73
+
74
+ model_path = "nanonets/Nanonets-OCR-s"
75
+
76
+ model = AutoModelForImageTextToText.from_pretrained(
77
+ model_path,
78
+ torch_dtype="auto",
79
+ device_map="auto",
80
+ attn_implementation="flash_attention_2"
81
+ )
82
+ model.eval()
83
+
84
+ tokenizer = AutoTokenizer.from_pretrained(model_path)
85
+ processor = AutoProcessor.from_pretrained(model_path)
86
+
87
+
88
+ def ocr_page_with_nanonets_s(image_path, model, processor, max_new_tokens=4096):
89
+ prompt = """Extract the text from the above document as if you were reading it naturally. Return the tables in html format. Return the equations in LaTeX representation. If there is an image in the document and image caption is not present, add a small description of the image inside the <img></img> tag; otherwise, add the image caption inside <img></img>. Watermarks should be wrapped in brackets. Ex: <watermark>OFFICIAL COPY</watermark>. Page numbers should be wrapped in brackets. Ex: <page_number>14</page_number> or <page_number>9/22</page_number>. Prefer using ☐ and β˜‘ for check boxes."""
90
+ image = Image.open(image_path)
91
+ messages = [
92
+ {"role": "system", "content": "You are a helpful assistant."},
93
+ {"role": "user", "content": [
94
+ {"type": "image", "image": f"file://{image_path}"},
95
+ {"type": "text", "text": prompt},
96
+ ]},
97
+ ]
98
+ text = processor.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
99
+ inputs = processor(text=[text], images=[image], padding=True, return_tensors="pt")
100
+ inputs = inputs.to(model.device)
101
+
102
+ output_ids = model.generate(**inputs, max_new_tokens=max_new_tokens, do_sample=False)
103
+ generated_ids = [output_ids[len(input_ids):] for input_ids, output_ids in zip(inputs.input_ids, output_ids)]
104
+
105
+ output_text = processor.batch_decode(generated_ids, skip_special_tokens=True, clean_up_tokenization_spaces=True)
106
+ return output_text[0]
107
+
108
+ image_path = "/path/to/your/document.jpg"
109
+ result = ocr_page_with_nanonets_s(image_path, model, processor, max_new_tokens=15000)
110
+ print(result)
111
+ ```
112
+
113
+ ### Using vLLM
114
+ 1. Start the vLLM server.
115
+ ```bash
116
+ vllm serve nanonets/Nanonets-OCR-s
117
+ ```
118
+ 2. Predict with the model
119
+ ```python
120
+ from openai import OpenAI
121
+ import base64
122
+
123
+ client = OpenAI(api_key="123", base_url="http://localhost:8000/v1")
124
+
125
+ model = "nanonets/Nanonets-OCR-s"
126
+
127
+ def encode_image(image_path):
128
+ with open(image_path, "rb") as image_file:
129
+ return base64.b64encode(image_file.read()).decode("utf-8")
130
+
131
+ def ocr_page_with_nanonets_s(img_base64):
132
+ response = client.chat.completions.create(
133
+ model=model,
134
+ messages=[
135
+ {
136
+ "role": "user",
137
+ "content": [
138
+ {
139
+ "type": "image_url",
140
+ "image_url": {"url": f"data:image/png;base64,{img_base64}"},
141
+ },
142
+ {
143
+ "type": "text",
144
+ "text": "Extract the text from the above document as if you were reading it naturally. Return the tables in html format. Return the equations in LaTeX representation. If there is an image in the document and image caption is not present, add a small description of the image inside the <img></img> tag; otherwise, add the image caption inside <img></img>. Watermarks should be wrapped in brackets. Ex: <watermark>OFFICIAL COPY</watermark>. Page numbers should be wrapped in brackets. Ex: <page_number>14</page_number> or <page_number>9/22</page_number>. Prefer using ☐ and β˜‘ for check boxes.",
145
+ },
146
+ ],
147
+ }
148
+ ],
149
+ temperature=0.0,
150
+ max_tokens=15000
151
+ )
152
+ return response.choices[0].message.content
153
+
154
+ test_img_path = "/path/to/your/document.jpg"
155
+ img_base64 = encode_image(test_img_path)
156
+ print(ocr_page_with_nanonets_s(img_base64))
157
+ ```
158
+
159
+ ### Using docext
160
+ ```python
161
+ pip install docext
162
+ python -m docext.app.app --model_name hosted_vllm/nanonets/Nanonets-OCR-s
163
+ ```
164
+ Checkout [GitHub](https://github.com/NanoNets/docext/tree/dev/markdown) for more details.
165
+
166
+
167
+ ## BibTex
168
+ ```
169
+ @misc{Nanonets-OCR-S,
170
+ title={Nanonets-OCR-S: A model for transforming documents into structured markdown with intelligent content recognition and semantic tagging},
171
+ author={Souvik Mandal and Ashish Talewar and Paras Ahuja and Prathamesh Juvatkar},
172
+ year={2025},
173
+ }
174
+ ```
175
+
176
+ <!--End Original Model Card-->
177
+
178
+ ---
179
+
180
+ # <span id="testllm" style="color: #7F7FFF;">πŸš€ If you find these models useful</span>
181
+
182
+ Help me test my **AI-Powered Quantum Network Monitor Assistant** with **quantum-ready security checks**:
183
+
184
+ πŸ‘‰ [Quantum Network Monitor](https://readyforquantum.com/?assistant=open&utm_source=huggingface&utm_medium=referral&utm_campaign=huggingface_repo_readme)
185
+
186
+
187
+ The full Open Source Code for the Quantum Network Monitor Service available at my github repos ( repos with NetworkMonitor in the name) : [Source Code Quantum Network Monitor](https://github.com/Mungert69). You will also find the code I use to quantize the models if you want to do it yourself [GGUFModelBuilder](https://github.com/Mungert69/GGUFModelBuilder)
188
+
189
+ πŸ’¬ **How to test**:
190
+ Choose an **AI assistant type**:
191
+ - `TurboLLM` (GPT-4.1-mini)
192
+ - `HugLLM` (Hugginface Open-source models)
193
+ - `TestLLM` (Experimental CPU-only)
194
+
195
+ ### **What I’m Testing**
196
+ I’m pushing the limits of **small open-source models for AI network monitoring**, specifically:
197
+ - **Function calling** against live network services
198
+ - **How small can a model go** while still handling:
199
+ - Automated **Nmap security scans**
200
+ - **Quantum-readiness checks**
201
+ - **Network Monitoring tasks**
202
+
203
+ 🟑 **TestLLM** – Current experimental model (llama.cpp on 2 CPU threads on huggingface docker space):
204
+ - βœ… **Zero-configuration setup**
205
+ - ⏳ 30s load time (slow inference but **no API costs**) . No token limited as the cost is low.
206
+ - πŸ”§ **Help wanted!** If you’re into **edge-device AI**, let’s collaborate!
207
+
208
+ ### **Other Assistants**
209
+ 🟒 **TurboLLM** – Uses **gpt-4.1-mini** :
210
+ - **It performs very well but unfortunatly OpenAI charges per token. For this reason tokens usage is limited.
211
+ - **Create custom cmd processors to run .net code on Quantum Network Monitor Agents**
212
+ - **Real-time network diagnostics and monitoring**
213
+ - **Security Audits**
214
+ - **Penetration testing** (Nmap/Metasploit)
215
+
216
+ πŸ”΅ **HugLLM** – Latest Open-source models:
217
+ - 🌐 Runs on Hugging Face Inference API. Performs pretty well using the lastest models hosted on Novita.
218
+
219
+ ### πŸ’‘ **Example commands you could test**:
220
+ 1. `"Give me info on my websites SSL certificate"`
221
+ 2. `"Check if my server is using quantum safe encyption for communication"`
222
+ 3. `"Run a comprehensive security audit on my server"`
223
+ 4. '"Create a cmd processor to .. (what ever you want)" Note you need to install a [Quantum Network Monitor Agent](https://readyforquantum.com/Download/?utm_source=huggingface&utm_medium=referral&utm_campaign=huggingface_repo_readme) to run the .net code on. This is a very flexible and powerful feature. Use with caution!
224
+
225
+ ### Final Word
226
+
227
+ I fund the servers used to create these model files, run the Quantum Network Monitor service, and pay for inference from Novita and OpenAIβ€”all out of my own pocket. All the code behind the model creation and the Quantum Network Monitor project is [open source](https://github.com/Mungert69). Feel free to use whatever you find helpful.
228
+
229
+ If you appreciate the work, please consider [buying me a coffee](https://www.buymeacoffee.com/mahadeva) β˜•. Your support helps cover service costs and allows me to raise token limits for everyone.
230
+
231
+ I'm also open to job opportunities or sponsorship.
232
+
233
+ Thank you! 😊