Learn R Programming

FMAT (version 2025.3)

set_cache_folder: Set (change) HuggingFace cache folder temporarily.

Description

This function allows you to change the default cache directory (when it lacks disk capacity) to another path (e.g., your portable SSD) temporarily.

Keep in mind: This function takes effect only for the current R session temporarily, so you should run this each time BEFORE you use other FMAT functions in an R session.

Usage

set_cache_folder(path)

Arguments

path

Folder path to store HuggingFace models.

Examples

Run this code
if (FALSE) {
library(FMAT)
set_cache_folder("D:/huggingface_cache/")
# -> models would be saved to "D:/huggingface_cache/hub/"
# run this function each time before using FMAT functions

BERT_download()
BERT_info()
}

Run the code above in your browser using DataLab