Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[troubleshooting] add 2 points of reference to the offline mode #11236

Merged
merged 7 commits into from
Apr 14, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ State-of-the-art NLP for everyone:
- Hands-on practitioners
- AI/ML/NLP teachers and educators

..
..
Copyright 2020 The HuggingFace Team. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
Expand Down Expand Up @@ -394,6 +394,7 @@ TensorFlow and/or Flax.

pretrained_models
examples
troubleshoot
stas00 marked this conversation as resolved.
Show resolved Hide resolved
custom_datasets
notebooks
sagemaker
Expand Down
23 changes: 23 additions & 0 deletions docs/source/troubleshoot.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!---
Copyright 2020 The HuggingFace Team. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

# Troubleshooting

This document is to help find solutions for common problems.

## Firewalled environments

Some cloud and intranet setups have their GPU instances firewalled to the outside world, so if your script is trying to download model weights or datasets it will first hang and then timeout. One possible solution in this situation is to use the ["offline-mode"](https://huggingface.co/transformers/installation.html#offline-mode).
stas00 marked this conversation as resolved.
Show resolved Hide resolved
5 changes: 5 additions & 0 deletions src/transformers/modeling_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -949,6 +949,11 @@ def from_pretrained(cls, pretrained_model_name_or_path: Optional[Union[str, os.P

Passing :obj:`use_auth_token=True` is required when you want to use a private model.

.. note::

Use the special `"offline-mode" <https://huggingface.co/transformers/installation.html#offline-mode>`__ to
stas00 marked this conversation as resolved.
Show resolved Hide resolved
use this method in a firewalled environment.

Examples::

>>> from transformers import BertConfig, BertModel
Expand Down