Skip to content

Commit

Permalink
Merge pull request #243 from gpengzhi/gpt2-xl
Browse files Browse the repository at this point in the history
Support GPT2-XL
  • Loading branch information
gpengzhi committed Nov 8, 2019
2 parents c8f452d + b34f922 commit 676c66a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions texar/tf/data/tokenizers/gpt2_tokenizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class GPT2Tokenizer(TokenizerBase, PretrainedGPT2Mixin):
'gpt2-small': 1024,
'gpt2-medium': 1024,
'gpt2-large': 1024,
'gpt2-xl': 1024,
}
_DEPRECATED_MAX_INPUT_SIZE = {
'117M': 1024,
Expand Down
3 changes: 3 additions & 0 deletions texar/tf/modules/pretrained/gpt2.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class PretrainedGPT2Mixin(PretrainedMixin, ABC):
* ``gpt2-small``: Small version of GPT-2, 124M parameters.
* ``gpt2-medium``: Medium version of GPT-2, 355M parameters.
* ``gpt2-large``: Large version of GPT-2, 774M parameters.
* ``gpt2-xl``: XL version of GPT-2, 1558M parameters.
We provide the following GPT2 classes:
Expand All @@ -74,6 +75,8 @@ class PretrainedGPT2Mixin(PretrainedMixin, ABC):
for file in _CHECKPOINT_FILES],
'gpt2-large': [_GPT2_PATH + f"774M/{file}"
for file in _CHECKPOINT_FILES],
'gpt2-xl': [_GPT2_PATH + f"1558M/{file}"
for file in _CHECKPOINT_FILES],
}

# Raise warning for the deprecated pre-trained model names
Expand Down

0 comments on commit 676c66a

Please sign in to comment.