You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
A clear and concise description of what the bug is.
It seems the cache root is wrong if it is defined in the environment instead of the default
To Reproduce
Steps to reproduce the behavior (e.g. which model did you train? what parameters did you use? etc.).
Create test.py:
fromflair.dataimportSentencefromflair.modelsimportSequenceTagger# make a sentencesentence=Sentence('I love Berlin .')
# load the NER taggertagger=SequenceTagger.load('ner')
# run NER over sentencetagger.predict(sentence)
and run FLAIR_CACHE_ROOT=$HOME/.cache/ python test.py
Expected behavior
A clear and concise description of what you expected to happen.
Example should work out of th box
Screenshots
If applicable, add screenshots to help explain your problem.
Environment (please complete the following information):
OS [e.g. iOS, Linux]: ubuntu
Version [e.g. flair-0.3.2]: 0.8.1 (or master)
Additional context
Add any other context about the problem here.
Simple fix is to cast to Path too when coming from env.
The text was updated successfully, but these errors were encountered:
I also looked into this and can reproduce the bug. In this context I searched every occurrence of flair.cache_root, which holds the env value. And every time it is used to construct a Path object.
What I therefore would propose is to initially construct the Path object in the flair/__init__.py and remove every other construction of it in the source code.
Otherwise only a Path construction in flair/models/sequence_tagger.py has to be added.
I could do a PR for both.
Note: There are 237 occurrences of Path(flair.cache_root)
Describe the bug
A clear and concise description of what the bug is.
It seems the cache root is wrong if it is defined in the environment instead of the default
To Reproduce
Steps to reproduce the behavior (e.g. which model did you train? what parameters did you use? etc.).
Create
test.py
:and run
FLAIR_CACHE_ROOT=$HOME/.cache/ python test.py
Expected behavior
A clear and concise description of what you expected to happen.
Example should work out of th box
Screenshots
If applicable, add screenshots to help explain your problem.
Environment (please complete the following information):
Additional context
Add any other context about the problem here.
Simple fix is to cast to Path too when coming from env.
The text was updated successfully, but these errors were encountered: