luxfer / runtime /inference /languages.py
mdxss's picture
Publish Luxfer early beta with runnable weights and language metadata
7b6f2cc verified
Raw History Blame Contribute Delete
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'}