luxfer / runtime /inference /catalog.py
mdxss's picture
Publish Luxfer early beta with runnable weights and language metadata
7b6f2cc verified
Raw History Blame Contribute Delete
1.24 kB
"""Display names and status for the complete supplied language inventory."""
import json
from pathlib import Path
NAMES={'ja':'Japanese','en':'English','zh-hans':'Chinese (Simplified)','zh-hant':'Chinese (Traditional)','ko':'Korean','ar':'Arabic','az':'Azerbaijani','be':'Belarusian','bg':'Bulgarian','bn':'Bengali','ca':'Catalan','ceb':'Cebuano','de':'German','es':'Spanish','et':'Estonian','eu':'Basque','fa':'Persian (Farsi)','fr':'French','gu':'Gujarati','he':'Hebrew','hi':'Hindi','hr':'Croatian','hu':'Hungarian','hy':'Armenian','id':'Indonesian','it':'Italian','jv':'Javanese','ka':'Georgian','kk':'Kazakh','km':'Khmer','lt':'Lithuanian','lv':'Latvian','ml':'Malayalam','mr':'Marathi','ms':'Malay','my':'Burmese','ne':'Nepali','nl':'Dutch','pa':'Punjabi','pl':'Polish','ru':'Russian','si':'Sinhala','sk':'Slovak','sl':'Slovenian','sr':'Serbian','sw':'Swahili','ta':'Tamil','te':'Telugu','th':'Thai','tl':'Tagalog','ur':'Urdu','uz':'Uzbek','vi':'Vietnamese','pt':'Portuguese (experimental)'}
def languages():
codes=json.loads((Path(__file__).resolve().parents[1]/'configs/languages.json').read_text())
return [dict(code=code,name=NAMES[code],status='experimental' if code=='pt' else 'upstream_listed') for code in codes+['pt']]