Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
c6c5c3fd
Commit
c6c5c3fd
authored
Feb 07, 2020
by
thomwolf
Browse files
style and quality
parent
961c6977
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
src/transformers/modeling_tf_utils.py
src/transformers/modeling_tf_utils.py
+3
-1
src/transformers/modeling_utils.py
src/transformers/modeling_utils.py
+3
-1
No files found.
src/transformers/modeling_tf_utils.py
View file @
c6c5c3fd
...
@@ -303,7 +303,9 @@ class TFPreTrainedModel(tf.keras.Model, TFModelUtilsMixin):
...
@@ -303,7 +303,9 @@ class TFPreTrainedModel(tf.keras.Model, TFModelUtilsMixin):
elif
os
.
path
.
isfile
(
pretrained_model_name_or_path
+
".index"
):
elif
os
.
path
.
isfile
(
pretrained_model_name_or_path
+
".index"
):
archive_file
=
pretrained_model_name_or_path
+
".index"
archive_file
=
pretrained_model_name_or_path
+
".index"
else
:
else
:
archive_file
=
hf_bucket_url
(
pretrained_model_name_or_path
,
postfix
=
(
WEIGHTS_NAME
if
from_pt
else
TF2_WEIGHTS_NAME
))
archive_file
=
hf_bucket_url
(
pretrained_model_name_or_path
,
postfix
=
(
WEIGHTS_NAME
if
from_pt
else
TF2_WEIGHTS_NAME
)
)
# redirect to the cache, if necessary
# redirect to the cache, if necessary
try
:
try
:
...
...
src/transformers/modeling_utils.py
View file @
c6c5c3fd
...
@@ -421,7 +421,9 @@ class PreTrainedModel(nn.Module, ModuleUtilsMixin):
...
@@ -421,7 +421,9 @@ class PreTrainedModel(nn.Module, ModuleUtilsMixin):
)
)
archive_file
=
pretrained_model_name_or_path
+
".index"
archive_file
=
pretrained_model_name_or_path
+
".index"
else
:
else
:
archive_file
=
hf_bucket_url
(
pretrained_model_name_or_path
,
postfix
=
(
TF2_WEIGHTS_NAME
if
from_tf
else
WEIGHTS_NAME
))
archive_file
=
hf_bucket_url
(
pretrained_model_name_or_path
,
postfix
=
(
TF2_WEIGHTS_NAME
if
from_tf
else
WEIGHTS_NAME
)
)
# redirect to the cache, if necessary
# redirect to the cache, if necessary
try
:
try
:
...
...
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