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
592d1e3a
"...git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "464b53f5e479d7f6a07fbc62b0f5335e9b55a1dc"
Commit
592d1e3a
authored
Jun 01, 2019
by
VictorSanh
Browse files
fix typos
parent
f836130b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
hubconfs/gpt2_hubconf.py
hubconfs/gpt2_hubconf.py
+2
-2
No files found.
hubconfs/gpt2_hubconf.py
View file @
592d1e3a
from
pytorch_pretrained_bert.tokenization_gpt2
import
GPT2Tokenizer
from
pytorch_pretrained_bert.modeling_
openai
import
(
from
pytorch_pretrained_bert.modeling_
gpt2
import
(
GPT2Model
,
GPT2LMHeadModel
,
GPT2DoubleHeadsModel
...
...
@@ -152,7 +152,7 @@ def gpt2DoubleHeadsModel(*args, **kwargs):
>>> tokens_tensor = torch.tensor([indexed_tokens])
>>> mc_token_ids = torch.LongTensor([ [len(tokenized_text)] ])
# Load
openAIGPT
DoubleHeadsModel
# Load
gpt2
DoubleHeadsModel
>>> model = torch.hub.load('huggingface/pytorch-pretrained-BERT', 'gpt2DoubleHeadsModel', 'gpt2')
>>> model.eval()
...
...
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