zafercavdar / fasttext-langdetect

80x faster and 95% accurate language identification with Fasttext
MIT License
141 stars 21 forks source link

Change default path of language identifier binary #6

Open jordiae opened 2 years ago

jordiae commented 2 years ago

Hi, I think having os.path.dirname(__file__) as the default directory for storing the binary would be a better default than "/tmp/fasttext-langdetect", since some systems might not have a working tmp directory. In any case, thanks for your library, it has been useful to me.

zafercavdar commented 1 year ago

Instead of replacing the default value, you can define FTLANG_CACHE environment variable dynamically before importing fasttext-langdetect like this:

import os
os.environ["FTLANG_CACHE"] = os.path.dirname(__file__)