# credit to the Stack Overflow user in the source link # from Python import os os.environ['TRANSFORMERS_CACHE'] = '/blabla/cache/' # from Bash """export TRANSFORMERS_CACHE=/blabla/cache/"""