knights-analytics / hugot

Huggingface transformer pipelines in Golang
Apache License 2.0
256 stars 11 forks source link

feat: adding ability to download models #12

Closed riccardopinosio closed 6 months ago

riccardopinosio commented 6 months ago

Adds the ability to download models directly from huggingface.

Changes: session object now has .DownloadModel method to download a model from huggingface cli can now download model directly with the --model parameter. Chain is: first check if --model is an existing path, if not check if --model is a model name that exists at $HOME/hugot/models, if not try to download --model to $HOME/hugot/models and use it.

Note: model download depends on huggingfaceModelDownloader. This functionality can be disabled at build time with the -t NODOWNLOAD tag.

closes #10