Make sure Kagglehub downloads models to the right place

Colab Enterprise is great. It’s wonderful, being able to define your own runtime templates for VMs to run Jupyter notebooks on. You can attach persistent disks to them and everything.

It’s wonderful right up until the point where you realize that certain libraries, in this case kagglehub, don’t let you specify where models get downloaded to on the local file system.

You can have a lovely 2TB disk mounted on /content but it’s not gonna matter if kagglehub.model_download caches its models somewhere else.

And it does!

It caches its models at ~/.cache/kagglehub/models.

There’s only one thing to do.

$ cd ~/.cache/kagglehub

$ mv models /content/

$ ln -s /content/models

That’s it, that’s all I’ve got for you today.