Skip to content

[Feature Request] Store Hugging Face models in a local project directory #3

@maocide

Description

@maocide

Currently, the transformers library downloads and caches models to the default system-wide directory (e.g., ~/.cache/huggingface/hub on Linux or C:\Users\USER\.cache\huggingface\hub on Windows).

This behavior has a few downsides for users:

  1. It consumes space on the primary system drive (the C: drive), which is often an SSD with limited capacity.
  2. It makes PlotCaption less portable. If a user moves the project folder to a different drive, the large model cache is left behind, and the models might need to be re-downloaded.
  3. Users have no direct control over where these multi-gigabyte models are stored.

Solution
The ideal solution is to have PlotCaption save all downloaded models into a sub-directory within its own project folder. For example, creating a ./models or ./cache folder at the root of the project to store everything.

This would make the entire application self-contained. When a user downloads PlotCaption, everything it needs and downloads will stay inside that one folder.

Additional context
This excellent suggestion was originally proposed by user willdone on Reddit, who has also contributed mods for the project. A huge thank you to them for their input!

This change will likely involve setting the cache_dir parameter when loading models via .from_pretrained().

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions