Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
6 changes: 0 additions & 6 deletions src/transformers/configuration_t5.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ class T5Config(PretrainedConfig):
def __init__(
self,
vocab_size=32128,
n_positions=512,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

T5 is not limited by a max number of positions since it uses relative pos embedding -> this param is never used in the Model File and should be deleted IMO: #8047

d_model=512,
d_kv=64,
d_ff=2048,
Expand All @@ -98,7 +97,6 @@ def __init__(
**kwargs,
)
self.vocab_size = vocab_size
self.n_positions = n_positions
self.d_model = d_model
self.d_kv = d_kv
self.d_ff = d_ff
Expand All @@ -112,10 +110,6 @@ def __init__(
self.layer_norm_epsilon = layer_norm_epsilon
self.initializer_factor = initializer_factor

@property
def max_position_embeddings(self):
return self.n_positions

@property
def hidden_size(self):
return self.d_model
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@

import argparse

import torch

from transformers import T5Config, T5Model, load_tf_weights_in_t5
from transformers.utils import logging

Expand All @@ -37,7 +35,7 @@ def convert_tf_checkpoint_to_pytorch(tf_checkpoint_path, config_file, pytorch_du

# Save pytorch-model
print("Save PyTorch model to {}".format(pytorch_dump_path))
torch.save(model.state_dict(), pytorch_dump_path)
model.save_pretrained(pytorch_dump_path)


if __name__ == "__main__":
Expand Down
Loading