Download runtime/frontend/common.py from islomov/gapi-uz-gapiring-v1: direct link, hf CLI and curl.
- Browser
- Download file 412 Bytes
-
https://huggingface.co/islomov/gapi-uz-gapiring-v1/resolve/main/runtime/frontend/common.py
- Command line
-
hf download hf://islomov/gapi-uz-gapiring-v1/runtime/frontend/common.py
-
curl -L -o common.py https://huggingface.co/islomov/gapi-uz-gapiring-v1/resolve/main/runtime/frontend/common.py
412 Bytes
| from __future__ import annotations | |
| import json | |
| from pathlib import Path | |
| HERE = Path(__file__).resolve().parent | |
| OUT = HERE | |
| TTS_UZ = HERE | |
| def read_jsonl(path): | |
| return [json.loads(line) for line in Path(path).read_text(encoding="utf-8").splitlines() if line.strip()] | |
| def write_jsonl(path, rows): | |
| Path(path).write_text("".join(json.dumps(r, ensure_ascii=False) + "\n" for r in rows), encoding="utf-8") | |