-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use pre-trained model without Internet connection #651
Comments
Hello @zhh210 - yes, you can pass the full model path to initialize most embeddings and taggers. For instance, if you have a tagging model downloaded to 'home/taggers/tagger.pt', you can initialize a SequenceTagger like this: tagger = SequenceTagger.load_from_file('home/taggers/tagger.pt') If you want to initialize embeddings with downloaded model, you can do this by passing the full path to the default constructor, e.g.: FlairEmbeddings('path/to/downloaded/model.pt') |
The example I was trying to use is glove. The download from is failing to connect aws (alan-nlp/resources/embeddings/glove.gensim) so I created copy in my local folder and in python when I was loading: It got an error saying:
Similary when I point BytePairEmbeddings to a local folder containing en.wiki.bpe.vs100000.model, it gives error of:
|
Hi @zhh210 can you try loading with |
@zhh210 老哥,需要下载两个文件,一个是glove.gensim.vectors.npy,一个是glove.gensim,然后放在同意目录下,然后用WordEmbeddings('/mydir/glove.gensim.vectors.npy')就行。 |
你好,@TorusHHH 这两个 glove.gensim.vectors.npy,和glove.gensim在哪里可以下载?可否给个链接 |
@TorusHHH 同问,哪里才能下载到glove.gensim和glove.gensim.vectors.npy这两个文件啊? |
可以用一台可以access internet的电脑,用flair自动下载好了然后从 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Is this example still valid: I'm trying to run flair SequenceTagger oflline. This works fine. On the nex run, I disabled internet connection and rerun the script but using
I know that site: https://flairnlp.github.io/docs but an class/methode - API documentation is missing. So I allways have to read endless lines of code to (sometimes) find which methods or parameters are valid. |
My network admin blocked any connection to aws so downloading pre-trained embeddings/models will fail due to network error. Is it possible to let flair point to the local directory where the embeddings/models were downloaded? Thanks.
The text was updated successfully, but these errors were encountered: