Download src/pagesynth/scripts/build_text.py from treoa/turkic-ocr-code: direct link, hf CLI and curl.
- Browser
- Download file 890 Bytes
-
https://huggingface.co/treoa/turkic-ocr-code/resolve/main/src/pagesynth/scripts/build_text.py
- Command line
-
hf download hf://treoa/turkic-ocr-code/src/pagesynth/scripts/build_text.py
-
curl -L -o build_text.py https://huggingface.co/treoa/turkic-ocr-code/resolve/main/src/pagesynth/scripts/build_text.py
890 Bytes
| """Driver: python build_text.py --lang kk --out DIR [--sakha-dir DIR] | |
| Needs: numpy, pyarrow, huggingface_hub (unauthenticated: token=False is used). | |
| """ | |
| import argparse | |
| import os | |
| import sys | |
| sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")) | |
| from pagesynth import textbuild # noqa: E402 | |
| def main(): | |
| ap = argparse.ArgumentParser() | |
| ap.add_argument("--lang", required=True) | |
| ap.add_argument("--out", required=True) | |
| ap.add_argument("--sakha-dir", default=None) | |
| ap.add_argument("--quota-wiki", type=int, default=400000) | |
| ap.add_argument("--quota-fw", type=int, default=400000) | |
| ap.add_argument("--max-groups", type=int, default=400) | |
| a = ap.parse_args() | |
| textbuild.build(a.lang, os.path.join(a.out, a.lang), a.quota_wiki, a.quota_fw, a.max_groups, a.sakha_dir, | |
| log=lambda *x: print(*x, flush=True)) | |
| main() | |