Closed xia0nan closed 2 years ago
I figured out how to use it. No issue now.
First download model
wget https://dl.fbaipublicfiles.com/nllb/lid/lid218e.bin
Then use it for inference
import fasttext
pretrained_lang_model = "lid218e.bin"
model = fasttext.load_model(pretrained_lang_model)
text = "γγγζ΅
θγ«γθ‘γγΎγγ"
predictions = model.predict(text, k=1)
print(predictions)
Model description
Thanks for supporting NLLB and closing this issue https://github.com/huggingface/transformers/issues/18043. I'm wondering if huggingface can further support the language identification model of NLLB? "LID (Language IDentification) model to predict the language of the input text."
Open source status
Provide useful links for the implementation
https://github.com/facebookresearch/fairseq/tree/nllb#lid-model