update config - fix gpt/gpt-2 from pretrained
This commit is contained in:
@@ -24,7 +24,7 @@ jobs:
|
|||||||
- checkout
|
- checkout
|
||||||
- run: sudo pip install --progress-bar off .
|
- run: sudo pip install --progress-bar off .
|
||||||
- run: sudo pip install pytest codecov pytest-cov
|
- run: sudo pip install pytest codecov pytest-cov
|
||||||
- run: sudo pip install tensorboardX scikit-learn
|
- run: sudo pip install tensorboardX scikit-learn mock
|
||||||
- run: python -m pytest -sv ./pytorch_transformers/tests/ --cov
|
- run: python -m pytest -sv ./pytorch_transformers/tests/ --cov
|
||||||
- run: python -m pytest -sv ./examples/
|
- run: python -m pytest -sv ./examples/
|
||||||
- run: codecov
|
- run: codecov
|
||||||
|
|||||||
@@ -423,7 +423,7 @@ class GPT2PreTrainedModel(PreTrainedModel):
|
|||||||
"""
|
"""
|
||||||
num_special_tokens = kwargs.pop('num_special_tokens', None)
|
num_special_tokens = kwargs.pop('num_special_tokens', None)
|
||||||
|
|
||||||
model = PreTrainedModel.from_pretrained(cls, pretrained_model_name_or_path, *inputs, **kwargs)
|
model = super(PreTrainedModel, cls).from_pretrained(pretrained_model_name_or_path, *inputs, **kwargs)
|
||||||
|
|
||||||
# Add additional embeddings for special tokens if needed
|
# Add additional embeddings for special tokens if needed
|
||||||
# This step also make sure we are still sharing the output and input embeddings after loading weights
|
# This step also make sure we are still sharing the output and input embeddings after loading weights
|
||||||
|
|||||||
@@ -431,7 +431,7 @@ class OpenAIGPTPreTrainedModel(PreTrainedModel):
|
|||||||
num_special_tokens = kwargs.get('num_special_tokens', None)
|
num_special_tokens = kwargs.get('num_special_tokens', None)
|
||||||
kwargs.pop('num_special_tokens', None)
|
kwargs.pop('num_special_tokens', None)
|
||||||
|
|
||||||
model = PreTrainedModel.from_pretrained(cls, pretrained_model_name_or_path, *inputs, **kwargs)
|
model = super(PreTrainedModel, cls).from_pretrained(pretrained_model_name_or_path, pretrained_model_name_or_path, *inputs, **kwargs)
|
||||||
|
|
||||||
# Add additional embeddings for special tokens if needed
|
# Add additional embeddings for special tokens if needed
|
||||||
# This step also make sure we are still sharing the output and input embeddings after loading weights
|
# This step also make sure we are still sharing the output and input embeddings after loading weights
|
||||||
|
|||||||
Reference in New Issue
Block a user