This function sets the cache directory for HuggingFace transformers. If a path is given, the function checks if the directory exists and then sets the TRANSFORMERS_CACHE
environment variable to this path.
If no path is provided, the function checks for the existing cache directory in a number of environment variables.
If none of these environment variables are set, it provides the user with information on the default cache directory.
Arguments
- path
Character string, the path to set as the cache directory. If NULL, the function will look for the cache directory in a number of environment variables. Default is NULL.
Value
Nothing is returned, this function is called for its side effect of setting the TRANSFORMERS_CACHE
environment variable, or providing information to the user.
References
HuggingFace Transformers: https://huggingface.co/transformers/index.html
See also
https://huggingface.co/docs/transformers/installation?highlight=transformers_cache#cache-setup
Other general functions:
perplexity_calc()