Instructions to use kesha-humonen/runic-reader-2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use kesha-humonen/runic-reader-2 with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
Download code/cutpreds.py from kesha-humonen/runic-reader-2: direct link, hf CLI and curl.
- Browser
- Download file 491 Bytes
-
https://huggingface.co/kesha-humonen/runic-reader-2/resolve/main/code/cutpreds.py
- Command line
-
hf download hf://kesha-humonen/runic-reader-2/code/cutpreds.py
-
curl -L -o cutpreds.py https://huggingface.co/kesha-humonen/runic-reader-2/resolve/main/code/cutpreds.py
491 Bytes
| """cutpreds.py <in.jsonl> <out.jsonl>: apply loopcut.cut_loops to recognizer outputs, keeping the raw output | |
| in pred_raw (the same transformation that produced preds/ocr_*_ocr4b_mixcut.jsonl).""" | |
| import json | |
| import sys | |
| from loopcut import cut_loops | |
| with open(sys.argv[2], "w") as f: | |
| for l in open(sys.argv[1]): | |
| r = json.loads(l) | |
| raw = r.get("pred_raw", r["pred"]) | |
| f.write(json.dumps(dict(r, pred=cut_loops(raw or ""), pred_raw=raw), ensure_ascii=False) + "\n") | |