Image-Text-to-Text
MLX
Safetensors
Chinese
ocr
rare-characters
ids
ideographic-description-sequence
glyphwiki
palaeography
Instructions to use OpenGlyph/OpenGlyph-OCR-IDS with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use OpenGlyph/OpenGlyph-OCR-IDS with MLX:
# Make sure mlx-vlm is installed # pip install --upgrade mlx-vlm from mlx_vlm import load, generate from mlx_vlm.prompt_utils import apply_chat_template from mlx_vlm.utils import load_config # Load the model model, processor = load("OpenGlyph/OpenGlyph-OCR-IDS") config = load_config("OpenGlyph/OpenGlyph-OCR-IDS") # Prepare input image = ["http://images.cocodataset.org/val2017/000000039769.jpg"] prompt = "Describe this image." # Apply chat template formatted_prompt = apply_chat_template( processor, config, prompt, num_images=1 ) # Generate output output = generate(model, processor, formatted_prompt, image) print(output) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Atomic Chat
File size: 1,392 Bytes
20fc05e | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | {
"top": 3,
"rule": {
"a": 1,
"b": 1,
"how": "mean",
"t": -1,
"m": 0.5,
"flat": true
},
"offset": 8,
"gate": null,
"gate_b": -0.5,
"gates_by": {
"a coded character | a glyph token": -0.25,
"a coded character | a rare character": -2.0,
"a glyph with a token | a glyph token": null,
"a glyph with a token | a rare character": -2.0,
"a new glyph | a glyph token": -0.5,
"a new glyph | a rare character": -2.0,
"forced: a coded character | a glyph token": -0.25,
"forced: a coded character | a rare character": -0.25,
"forced: a glyph with a token | a glyph token": null,
"forced: a new glyph | a glyph token": null,
"forced: a new glyph | a rare character": -0.1
},
"open_hard": "speller",
"note": "the settings OpenGlyph-OCR-IDS was measured with, chosen on tuning lines (never on a test): offset = what is added to the opener's evidence that an IDS begins; gate = how surely the unfolding must read for its IDS to stand alone (null: only where the speller writes the same glyph); gate_b and gates_by = how surely the speller must spell for its IDS to stand, by the kind of place (\"forced: ...\" = a place the opener did not ask for, read because the reader writes a rare character or a glyph token there; null = never); open_hard = such places are read by the speller; top = the structures tried; rule = how the unfolding chooses among its cuts"
}
|