File size: 704 Bytes
40ee691
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import logging
from transformers.utils import move_cache

# Set up logging to see the progress
logging.basicConfig(level=logging.INFO)
log = logging.getLogger(__name__)

log.info("Starting Hugging Face cache migration...")
log.info("This is a one-time operation and may take several minutes depending on your cache size and disk speed.")
log.info("Please be patient and let the script complete.")

try:
    move_cache()
    log.info("Cache migration completed successfully!")
    log.info("You can now run your main application without the delay.")
except Exception as e:
    log.error(f"An error occurred during cache migration: {e}")
    log.error("Please check your file permissions and disk space.")