Skip to content

Raise initial HTTPError if pipeline is not cached locally#4230

Merged
patrickvonplaten merged 2 commits intomainfrom
reraise-initial-error-if-pipeline-not-cached
Jul 24, 2023
Merged

Raise initial HTTPError if pipeline is not cached locally#4230
patrickvonplaten merged 2 commits intomainfrom
reraise-initial-error-if-pipeline-not-cached

Conversation

@Wauplin
Copy link
Copy Markdown
Collaborator

@Wauplin Wauplin commented Jul 24, 2023

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)

@HuggingFaceDocBuilderDev
Copy link
Copy Markdown

HuggingFaceDocBuilderDev commented Jul 24, 2023

The documentation is not available anymore as the PR was closed or merged.

Copy link
Copy Markdown
Contributor

@patrickvonplaten patrickvonplaten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a bunch!

@patrickvonplaten patrickvonplaten merged commit 06eda5b into main Jul 24, 2023
orpatashnik pushed a commit to orpatashnik/diffusers that referenced this pull request Aug 1, 2023
…e#4230)

* Raise initial HTTPError if pipeline is not cached locally

* make style
orpatashnik pushed a commit to orpatashnik/diffusers that referenced this pull request Aug 1, 2023
…e#4230)

* Raise initial HTTPError if pipeline is not cached locally

* make style
orpatashnik pushed a commit to orpatashnik/diffusers that referenced this pull request Aug 1, 2023
…e#4230)

* Raise initial HTTPError if pipeline is not cached locally

* make style
@kashif kashif deleted the reraise-initial-error-if-pipeline-not-cached branch September 11, 2023 19:07
yoonseokjin pushed a commit to yoonseokjin/diffusers that referenced this pull request Dec 25, 2023
…e#4230)

* Raise initial HTTPError if pipeline is not cached locally

* make style
AmericanPresidentJimmyCarter pushed a commit to AmericanPresidentJimmyCarter/diffusers that referenced this pull request Apr 26, 2024
…e#4230)

* Raise initial HTTPError if pipeline is not cached locally

* make style
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants