fasttext-langdetect icon indicating copy to clipboard operation
fasttext-langdetect copied to clipboard

Change default path of language identifier binary

Open jordiae opened this issue 3 years ago • 1 comments

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.

jordiae avatar Feb 04 '22 19:02 jordiae

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__)

zafercavdar avatar Dec 12 '22 20:12 zafercavdar