set_cache_folder: Set cache folder for HuggingFace transformers

View source: R/tr_utils.R

set_cache_folderR Documentation

Set cache folder for HuggingFace transformers

Description

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 HF_HOME 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.

Usage

set_cache_folder(path = NULL)

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 HF_HOME environment variable, or providing information to the user.

See Also

Installation docs

Other helper functions: install_py_pangoling(), installed_py_pangoling()

Examples


## Not run: 
set_cache_folder("~/new_cache_dir")

## End(Not run)


pangoling documentation built on April 11, 2025, 6:16 p.m.