Fixing offline mode for pipeline (when inferring task). (#21113)
* Fixing offline mode for pipeline (when inferring task).
* Update src/transformers/pipelines/__init__.py
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
* Updating test to reflect change in exception.
* Fixing offline mode.
* Clean.
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>