Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
013a7dbe
Unverified
Commit
013a7dbe
authored
Apr 04, 2022
by
Nicolas Patry
Committed by
GitHub
Apr 04, 2022
Browse files
Making the impossible to connect error actually report the right URL. (#16446)
parent
ad0cba08
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
6 deletions
+11
-6
src/transformers/configuration_utils.py
src/transformers/configuration_utils.py
+2
-1
src/transformers/feature_extraction_utils.py
src/transformers/feature_extraction_utils.py
+2
-1
src/transformers/modeling_flax_utils.py
src/transformers/modeling_flax_utils.py
+2
-1
src/transformers/modeling_tf_utils.py
src/transformers/modeling_tf_utils.py
+2
-1
src/transformers/modeling_utils.py
src/transformers/modeling_utils.py
+3
-2
No files found.
src/transformers/configuration_utils.py
View file @
013a7dbe
...
@@ -31,6 +31,7 @@ from . import __version__
...
@@ -31,6 +31,7 @@ from . import __version__
from
.dynamic_module_utils
import
custom_object_save
from
.dynamic_module_utils
import
custom_object_save
from
.utils
import
(
from
.utils
import
(
CONFIG_NAME
,
CONFIG_NAME
,
HUGGINGFACE_CO_RESOLVE_ENDPOINT
,
EntryNotFoundError
,
EntryNotFoundError
,
PushToHubMixin
,
PushToHubMixin
,
RepositoryNotFoundError
,
RepositoryNotFoundError
,
...
@@ -626,7 +627,7 @@ class PretrainedConfig(PushToHubMixin):
...
@@ -626,7 +627,7 @@ class PretrainedConfig(PushToHubMixin):
)
)
except
ValueError
:
except
ValueError
:
raise
EnvironmentError
(
raise
EnvironmentError
(
"We couldn't connect to '
https://huggingface.co/
' to load this model, couldn't find it in the cached "
f
"We couldn't connect to '
{
HUGGINGFACE_CO_RESOLVE_ENDPOINT
}
' to load this model, couldn't find it in the cached "
f
"files and it looks like
{
pretrained_model_name_or_path
}
is not the path to a directory containing a "
f
"files and it looks like
{
pretrained_model_name_or_path
}
is not the path to a directory containing a "
"{configuration_file} file.
\n
Checkout your internet connection or see how to run the library in "
"{configuration_file} file.
\n
Checkout your internet connection or see how to run the library in "
"offline mode at 'https://huggingface.co/docs/transformers/installation#offline-mode'."
"offline mode at 'https://huggingface.co/docs/transformers/installation#offline-mode'."
...
...
src/transformers/feature_extraction_utils.py
View file @
013a7dbe
...
@@ -29,6 +29,7 @@ from requests import HTTPError
...
@@ -29,6 +29,7 @@ from requests import HTTPError
from
.dynamic_module_utils
import
custom_object_save
from
.dynamic_module_utils
import
custom_object_save
from
.utils
import
(
from
.utils
import
(
FEATURE_EXTRACTOR_NAME
,
FEATURE_EXTRACTOR_NAME
,
HUGGINGFACE_CO_RESOLVE_ENDPOINT
,
EntryNotFoundError
,
EntryNotFoundError
,
PushToHubMixin
,
PushToHubMixin
,
RepositoryNotFoundError
,
RepositoryNotFoundError
,
...
@@ -433,7 +434,7 @@ class FeatureExtractionMixin(PushToHubMixin):
...
@@ -433,7 +434,7 @@ class FeatureExtractionMixin(PushToHubMixin):
)
)
except
ValueError
:
except
ValueError
:
raise
EnvironmentError
(
raise
EnvironmentError
(
"We couldn't connect to '
https://huggingface.co/
' to load this model, couldn't find it in the cached "
f
"We couldn't connect to '
{
HUGGINGFACE_CO_RESOLVE_ENDPOINT
}
' to load this model, couldn't find it in the cached "
f
"files and it looks like
{
pretrained_model_name_or_path
}
is not the path to a directory containing a "
f
"files and it looks like
{
pretrained_model_name_or_path
}
is not the path to a directory containing a "
f
"
{
FEATURE_EXTRACTOR_NAME
}
file.
\n
Checkout your internet connection or see how to run the library in "
f
"
{
FEATURE_EXTRACTOR_NAME
}
file.
\n
Checkout your internet connection or see how to run the library in "
"offline mode at 'https://huggingface.co/docs/transformers/installation#offline-mode'."
"offline mode at 'https://huggingface.co/docs/transformers/installation#offline-mode'."
...
...
src/transformers/modeling_flax_utils.py
View file @
013a7dbe
...
@@ -34,6 +34,7 @@ from .generation_flax_utils import FlaxGenerationMixin
...
@@ -34,6 +34,7 @@ from .generation_flax_utils import FlaxGenerationMixin
from
.modeling_flax_pytorch_utils
import
load_pytorch_checkpoint_in_flax_state_dict
from
.modeling_flax_pytorch_utils
import
load_pytorch_checkpoint_in_flax_state_dict
from
.utils
import
(
from
.utils
import
(
FLAX_WEIGHTS_NAME
,
FLAX_WEIGHTS_NAME
,
HUGGINGFACE_CO_RESOLVE_ENDPOINT
,
WEIGHTS_NAME
,
WEIGHTS_NAME
,
EntryNotFoundError
,
EntryNotFoundError
,
PushToHubMixin
,
PushToHubMixin
,
...
@@ -530,7 +531,7 @@ class FlaxPreTrainedModel(PushToHubMixin, FlaxGenerationMixin):
...
@@ -530,7 +531,7 @@ class FlaxPreTrainedModel(PushToHubMixin, FlaxGenerationMixin):
)
)
except
ValueError
:
except
ValueError
:
raise
EnvironmentError
(
raise
EnvironmentError
(
"We couldn't connect to '
https://huggingface.co/
' to load this model, couldn't find it in the cached "
f
"We couldn't connect to '
{
HUGGINGFACE_CO_RESOLVE_ENDPOINT
}
' to load this model, couldn't find it in the cached "
f
"files and it looks like
{
pretrained_model_name_or_path
}
is not the path to a directory "
f
"files and it looks like
{
pretrained_model_name_or_path
}
is not the path to a directory "
f
"containing a file named
{
FLAX_WEIGHTS_NAME
}
or
{
WEIGHTS_NAME
}
.
\n
"
f
"containing a file named
{
FLAX_WEIGHTS_NAME
}
or
{
WEIGHTS_NAME
}
.
\n
"
"Checkout your internet connection or see how to run the library in offline mode at "
"Checkout your internet connection or see how to run the library in offline mode at "
...
...
src/transformers/modeling_tf_utils.py
View file @
013a7dbe
...
@@ -43,6 +43,7 @@ from .tf_utils import shape_list
...
@@ -43,6 +43,7 @@ from .tf_utils import shape_list
from
.tokenization_utils_base
import
BatchEncoding
from
.tokenization_utils_base
import
BatchEncoding
from
.utils
import
(
from
.utils
import
(
DUMMY_INPUTS
,
DUMMY_INPUTS
,
HUGGINGFACE_CO_RESOLVE_ENDPOINT
,
TF2_WEIGHTS_NAME
,
TF2_WEIGHTS_NAME
,
WEIGHTS_NAME
,
WEIGHTS_NAME
,
EntryNotFoundError
,
EntryNotFoundError
,
...
@@ -1685,7 +1686,7 @@ class TFPreTrainedModel(tf.keras.Model, TFModelUtilsMixin, TFGenerationMixin, Pu
...
@@ -1685,7 +1686,7 @@ class TFPreTrainedModel(tf.keras.Model, TFModelUtilsMixin, TFGenerationMixin, Pu
)
)
except
ValueError
:
except
ValueError
:
raise
EnvironmentError
(
raise
EnvironmentError
(
"We couldn't connect to '
https://huggingface.co/
' to load this model, couldn't find it in the cached "
f
"We couldn't connect to '
{
HUGGINGFACE_CO_RESOLVE_ENDPOINT
}
' to load this model, couldn't find it in the cached "
f
"files and it looks like
{
pretrained_model_name_or_path
}
is not the path to a directory "
f
"files and it looks like
{
pretrained_model_name_or_path
}
is not the path to a directory "
f
"containing a file named
{
TF2_WEIGHTS_NAME
}
or
{
WEIGHTS_NAME
}
.
\n
"
f
"containing a file named
{
TF2_WEIGHTS_NAME
}
or
{
WEIGHTS_NAME
}
.
\n
"
"Checkout your internet connection or see how to run the library in offline mode at "
"Checkout your internet connection or see how to run the library in offline mode at "
...
...
src/transformers/modeling_utils.py
View file @
013a7dbe
...
@@ -40,6 +40,7 @@ from .generation_utils import GenerationMixin
...
@@ -40,6 +40,7 @@ from .generation_utils import GenerationMixin
from
.utils
import
(
from
.utils
import
(
DUMMY_INPUTS
,
DUMMY_INPUTS
,
FLAX_WEIGHTS_NAME
,
FLAX_WEIGHTS_NAME
,
HUGGINGFACE_CO_RESOLVE_ENDPOINT
,
TF2_WEIGHTS_NAME
,
TF2_WEIGHTS_NAME
,
TF_WEIGHTS_NAME
,
TF_WEIGHTS_NAME
,
WEIGHTS_INDEX_NAME
,
WEIGHTS_INDEX_NAME
,
...
@@ -331,7 +332,7 @@ def get_checkpoint_shard_files(
...
@@ -331,7 +332,7 @@ def get_checkpoint_shard_files(
)
)
except
HTTPError
:
except
HTTPError
:
raise
EnvironmentError
(
raise
EnvironmentError
(
f
"We couldn't connect to '
https://huggingface.co/
' to load
{
shard_filename
}
. You should try again "
f
"We couldn't connect to '
{
HUGGINGFACE_CO_RESOLVE_ENDPOINT
}
' to load
{
shard_filename
}
. You should try again "
"after checking your internet connection."
"after checking your internet connection."
)
)
...
@@ -1749,7 +1750,7 @@ class PreTrainedModel(nn.Module, ModuleUtilsMixin, GenerationMixin, PushToHubMix
...
@@ -1749,7 +1750,7 @@ class PreTrainedModel(nn.Module, ModuleUtilsMixin, GenerationMixin, PushToHubMix
)
)
except
ValueError
:
except
ValueError
:
raise
EnvironmentError
(
raise
EnvironmentError
(
"We couldn't connect to '
https://huggingface.co/
' to load this model, couldn't find it in the cached "
f
"We couldn't connect to '
{
HUGGINGFACE_CO_RESOLVE_ENDPOINT
}
' to load this model, couldn't find it in the cached "
f
"files and it looks like
{
pretrained_model_name_or_path
}
is not the path to a directory "
f
"files and it looks like
{
pretrained_model_name_or_path
}
is not the path to a directory "
f
"containing a file named
{
WEIGHTS_NAME
}
,
{
TF2_WEIGHTS_NAME
}
,
{
TF_WEIGHTS_NAME
}
or "
f
"containing a file named
{
WEIGHTS_NAME
}
,
{
TF2_WEIGHTS_NAME
}
,
{
TF_WEIGHTS_NAME
}
or "
f
"
{
FLAX_WEIGHTS_NAME
}
.
\n
"
f
"
{
FLAX_WEIGHTS_NAME
}
.
\n
"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment