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
f9f395b2
Unverified
Commit
f9f395b2
authored
Dec 05, 2019
by
Thomas Wolf
Committed by
GitHub
Dec 05, 2019
Browse files
Merge pull request #1735 from ondewo/tf-do-not-use-gpu-on-import
Do not use GPU when importing transformers
parents
75a97af6
124409d0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
transformers/modeling_tf_utils.py
transformers/modeling_tf_utils.py
+9
-1
No files found.
transformers/modeling_tf_utils.py
View file @
f9f395b2
...
@@ -51,7 +51,15 @@ class TFPreTrainedModel(tf.keras.Model):
...
@@ -51,7 +51,15 @@ class TFPreTrainedModel(tf.keras.Model):
config_class
=
None
config_class
=
None
pretrained_model_archive_map
=
{}
pretrained_model_archive_map
=
{}
base_model_prefix
=
""
base_model_prefix
=
""
dummy_inputs
=
tf
.
constant
(
DUMMY_INPUTS
)
# dummy inputs to build the network
@
property
def
dummy_inputs
(
self
):
""" Dummy inputs to build the network.
Returns:
tf.Tensor with dummy inputs
"""
return
tf
.
constant
(
DUMMY_INPUTS
)
def
__init__
(
self
,
config
,
*
inputs
,
**
kwargs
):
def
__init__
(
self
,
config
,
*
inputs
,
**
kwargs
):
super
(
TFPreTrainedModel
,
self
).
__init__
(
*
inputs
,
**
kwargs
)
super
(
TFPreTrainedModel
,
self
).
__init__
(
*
inputs
,
**
kwargs
)
...
...
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