Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
273617b8
Commit
273617b8
authored
Jul 11, 2019
by
thomwolf
Browse files
update config - fix gpt/gpt-2 from pretrained
parent
6b13f4cb
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
3 deletions
+3
-3
.circleci/config.yml
.circleci/config.yml
+1
-1
pytorch_transformers/modeling_gpt2.py
pytorch_transformers/modeling_gpt2.py
+1
-1
pytorch_transformers/modeling_openai.py
pytorch_transformers/modeling_openai.py
+1
-1
No files found.
.circleci/config.yml
View file @
273617b8
...
...
@@ -24,7 +24,7 @@ jobs:
-
checkout
-
run
:
sudo pip install --progress-bar off .
-
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 ./examples/
-
run
:
codecov
...
...
pytorch_transformers/modeling_gpt2.py
View file @
273617b8
...
...
@@ -423,7 +423,7 @@ class GPT2PreTrainedModel(PreTrainedModel):
"""
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
# This step also make sure we are still sharing the output and input embeddings after loading weights
...
...
pytorch_transformers/modeling_openai.py
View file @
273617b8
...
...
@@ -431,7 +431,7 @@ class OpenAIGPTPreTrainedModel(PreTrainedModel):
num_special_tokens
=
kwargs
.
get
(
'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
# This step also make sure we are still sharing the output and input embeddings after loading weights
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment