Skip to content

Commit

Permalink
make fix-copies
Browse files Browse the repository at this point in the history
  • Loading branch information
Rocketknight1 committed Dec 6, 2023
1 parent 907e329 commit 0f16397
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/transformers/models/electra/modeling_tf_electra.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,7 @@ def __init__(self, config: ElectraConfig, **kwargs):
activation="tanh",
name="dense",
)
self.config = config

def call(self, hidden_states: tf.Tensor) -> tf.Tensor:
# We "pool" the model by simply taking the hidden state corresponding
Expand All @@ -561,7 +562,7 @@ def build(self, input_shape=None):
self.built = True
if getattr(self, "dense", None) is not None:
with tf.name_scope(self.dense.name):
self.dense.build(None)
self.dense.build(self.config.hidden_size)


# Copied from transformers.models.albert.modeling_tf_albert.TFAlbertEmbeddings with Albert->Electra
Expand Down
5 changes: 3 additions & 2 deletions src/transformers/models/hubert/modeling_tf_hubert.py
Original file line number Diff line number Diff line change
Expand Up @@ -568,8 +568,9 @@ def build(self, input_shape=None):
if self.built:
return
self.built = True
with tf.name_scope(self.conv.name):
self.conv.build(self.config.hidden_size)
if getattr(self, "conv", None) is not None:
with tf.name_scope(self.conv.name):
self.conv.build(self.config.hidden_size)


# Copied from transformers.models.wav2vec2.modeling_tf_wav2vec2.TFWav2Vec2SamePadLayer with Wav2Vec2->Hubert
Expand Down

0 comments on commit 0f16397

Please sign in to comment.