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
3fae83d2
Unverified
Commit
3fae83d2
authored
Feb 11, 2022
by
Joao Gante
Committed by
GitHub
Feb 11, 2022
Browse files
TF: Add informative warning for inexistent CPU backprop ops (#15612)
* Add informative warning
parent
7e4844fc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
+14
-0
src/transformers/models/hubert/modeling_tf_hubert.py
src/transformers/models/hubert/modeling_tf_hubert.py
+7
-0
src/transformers/models/wav2vec2/modeling_tf_wav2vec2.py
src/transformers/models/wav2vec2/modeling_tf_wav2vec2.py
+7
-0
No files found.
src/transformers/models/hubert/modeling_tf_hubert.py
View file @
3fae83d2
...
...
@@ -1293,6 +1293,13 @@ class TFHubertPreTrainedModel(TFPreTrainedModel):
}
return
dummy_inputs
def
__init__
(
self
,
config
,
*
inputs
,
**
kwargs
):
super
().
__init__
(
config
,
*
inputs
,
**
kwargs
)
logger
.
warning
(
f
"
\n
{
self
.
__class__
.
__name__
}
has backpropagation operations that are NOT supported on CPU. If you wish "
"to train/fine-tine this model, you need a GPU or a TPU"
)
@
tf
.
function
def
serving
(
self
,
inputs
):
output
=
self
.
call
(
input_values
=
inputs
,
training
=
False
)
...
...
src/transformers/models/wav2vec2/modeling_tf_wav2vec2.py
View file @
3fae83d2
...
...
@@ -1319,6 +1319,13 @@ class TFWav2Vec2PreTrainedModel(TFPreTrainedModel):
}
return
dummy_inputs
def
__init__
(
self
,
config
,
*
inputs
,
**
kwargs
):
super
().
__init__
(
config
,
*
inputs
,
**
kwargs
)
logger
.
warning
(
f
"
\n
{
self
.
__class__
.
__name__
}
has backpropagation operations that are NOT supported on CPU. If you wish "
"to train/fine-tine this model, you need a GPU or a TPU"
)
@
tf
.
function
def
serving
(
self
,
inputs
):
output
=
self
.
call
(
input_values
=
inputs
,
training
=
False
)
...
...
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