Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
base_model: ds4sd/SmolDocling-256M-preview
|
| 4 |
+
tags:
|
| 5 |
+
- ocr
|
| 6 |
+
- document-understanding
|
| 7 |
+
- doctags
|
| 8 |
+
- vision-language
|
| 9 |
+
- gguf
|
| 10 |
+
- crispembed
|
| 11 |
+
- ggml
|
| 12 |
+
language:
|
| 13 |
+
- en
|
| 14 |
+
---
|
| 15 |
+
|
| 16 |
+
# SmolDocling-256M GGUF
|
| 17 |
+
|
| 18 |
+
GGUF conversions of [ds4sd/SmolDocling-256M-preview](https://huggingface.co/ds4sd/SmolDocling-256M-preview) for [CrispEmbed](https://github.com/CrispStrobe/CrispEmbed) inference.
|
| 19 |
+
|
| 20 |
+
Ultra-compact document conversion model (256M params). Generates DocTags structured markup from page images — OCR, layout, tables, formulas, code, charts.
|
| 21 |
+
|
| 22 |
+
## Model variants
|
| 23 |
+
|
| 24 |
+
| File | Quant | Size | Notes |
|
| 25 |
+
|------|-------|------|-------|
|
| 26 |
+
| `smoldocling-f16.gguf` | F16 | 491 MB | Full precision |
|
| 27 |
+
| `smoldocling-q8_0.gguf` | Q8_0 | 261 MB | Recommended |
|
| 28 |
+
| `smoldocling-q4_k.gguf` | Q4_K | 153 MB | Max compression |
|
| 29 |
+
|
| 30 |
+
## Architecture
|
| 31 |
+
|
| 32 |
+
- **Vision**: SigLIP ViT (12L, 768d, 12 heads, patch=16, 512px)
|
| 33 |
+
- **Connector**: Pixel shuffle (scale=4, 1024→64 tokens) + Linear(12288→576)
|
| 34 |
+
- **LLM**: SmolLM2-135M (30L, 576d, GQA 9/3, SwiGLU, RoPE)
|
| 35 |
+
- **Parameters**: 256M total (93M vision + 135M LLM + connector)
|
| 36 |
+
- **Output**: DocTags (structured XML-like document markup)
|
| 37 |
+
|
| 38 |
+
Parity vs HF reference: vision cos=0.9998, connector cos=0.9999.
|
| 39 |
+
|
| 40 |
+
## Usage
|
| 41 |
+
|
| 42 |
+
```bash
|
| 43 |
+
# CLI
|
| 44 |
+
./crispembed -m smoldocling-q8_0.gguf --ocr document.png
|
| 45 |
+
|
| 46 |
+
# Server
|
| 47 |
+
./crispembed-server --ocr smoldocling-q8_0.gguf --port 8080
|
| 48 |
+
curl -X POST http://localhost:8080/math/ocr -F "image=@document.png"
|
| 49 |
+
```
|
| 50 |
+
|
| 51 |
+
```python
|
| 52 |
+
from crispembed import CrispMathOcr
|
| 53 |
+
|
| 54 |
+
ocr = CrispMathOcr("smoldocling-q8_0.gguf")
|
| 55 |
+
doctags = ocr.recognize("document.png")
|
| 56 |
+
print(doctags) # <doctag><text>...</text>...</doctag>
|
| 57 |
+
```
|
| 58 |
+
|
| 59 |
+
## License
|
| 60 |
+
|
| 61 |
+
Apache-2.0 — same as the base model.
|
| 62 |
+
|
| 63 |
+
## Credits
|
| 64 |
+
|
| 65 |
+
Original model by [Docling Team, IBM Research](https://huggingface.co/ds4sd). GGUF conversion and inference engine by [CrispEmbed](https://github.com/CrispStrobe/CrispEmbed).
|