Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
7 changes: 7 additions & 0 deletions src/transformers/models/hubert/modeling_tf_hubert.py
Original file line number Diff line number Diff line change
Expand Up @@ -1293,6 +1293,13 @@ def dummy_inputs(self) -> Dict[str, tf.Tensor]:
}
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)
Expand Down
7 changes: 7 additions & 0 deletions src/transformers/models/wav2vec2/modeling_tf_wav2vec2.py
Original file line number Diff line number Diff line change
Expand Up @@ -1319,6 +1319,13 @@ def dummy_inputs(self) -> Dict[str, tf.Tensor]:
}
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)
Expand Down