Download runtime/inference/languages.py from hscr/luxfer: direct link, hf CLI and curl.
- Browser
- Download file 625 Bytes
-
https://huggingface.co/hscr/luxfer/resolve/main/runtime/inference/languages.py
- Command line
-
hf download hf://hscr/luxfer/runtime/inference/languages.py
-
curl -L -o languages.py https://huggingface.co/hscr/luxfer/resolve/main/runtime/inference/languages.py
625 Bytes
| """Language claims from the supplied upstream card, not inferred from tokenizer coverage.""" | |
| import json | |
| from pathlib import Path | |
| SUPPORTED=frozenset(json.loads((Path(__file__).resolve().parents[1]/'configs/languages.json').read_text())) | |
| def canonical(code):return 'ja-easy' if code=='ja(easy)' else code | |
| def support_status(source,target): | |
| allowed=SUPPORTED|{'ja-easy'} | |
| unsupported=sorted({canonical(code) for code in (source,target)}-allowed) | |
| return {'supported_pair':not unsupported,'unsupported_codes':unsupported, | |
| 'basis':'supplied upstream model card; quality not guaranteed by listed support'} | |