Raise initial HTTPError if pipeline is not cached locally by Wauplin · Pull Request #4230 · huggingface/diffusers (original) (raw)
This PR fixes the workflow when loading a diffusers pipeline. Since #3447, if any error happens while fetching model metadata (i.e. the model_info(...)
call), we force local_files_only=True
to try to load the model from cache even if the Hub is down. The side effect of this is that if a valid error happens (repository not found or gated repo error), it is silently ignored and the user gets a non-explicit "file not found" error.
This PR fixes this by re-raising the initial error when the model is not found locally. A custom message is added to let the user know that we tried to fetch the model locally but it's not there.
(initially reported by @osanseviero in private slack)