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
72622926
"git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "4ebb52afdb4dc4bcd599e7cb503763e5d4afc962"
Commit
72622926
authored
Aug 06, 2019
by
wangfei
Browse files
Fix examples in docstring
parent
f889e77b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
pytorch_transformers/modeling_transfo_xl.py
pytorch_transformers/modeling_transfo_xl.py
+10
-10
No files found.
pytorch_transformers/modeling_transfo_xl.py
View file @
72622926
...
@@ -968,11 +968,11 @@ class TransfoXLModel(TransfoXLPreTrainedModel):
...
@@ -968,11 +968,11 @@ class TransfoXLModel(TransfoXLPreTrainedModel):
Examples::
Examples::
>>>
tokenizer = TransfoXLTokenizer.from_pretrained('transfo-xl-wt103')
tokenizer = TransfoXLTokenizer.from_pretrained('transfo-xl-wt103')
>>>
model = TransfoXLModel.from_pretrained('transfo-xl-wt103')
model = TransfoXLModel.from_pretrained('transfo-xl-wt103')
>>>
input_ids = torch.tensor(tokenizer.encode("Hello, my dog is cute")).unsqueeze(0) # Batch size 1
input_ids = torch.tensor(tokenizer.encode("Hello, my dog is cute")).unsqueeze(0) # Batch size 1
>>>
outputs = model(input_ids)
outputs = model(input_ids)
>>>
last_hidden_states, mems = outputs[:2]
last_hidden_states, mems = outputs[:2]
"""
"""
def
__init__
(
self
,
config
):
def
__init__
(
self
,
config
):
...
@@ -1283,11 +1283,11 @@ class TransfoXLLMHeadModel(TransfoXLPreTrainedModel):
...
@@ -1283,11 +1283,11 @@ class TransfoXLLMHeadModel(TransfoXLPreTrainedModel):
Examples::
Examples::
>>>
tokenizer = TransfoXLTokenizer.from_pretrained('transfo-xl-wt103')
tokenizer = TransfoXLTokenizer.from_pretrained('transfo-xl-wt103')
>>>
model = TransfoXLLMHeadModel.from_pretrained('transfo-xl-wt103')
model = TransfoXLLMHeadModel.from_pretrained('transfo-xl-wt103')
>>>
input_ids = torch.tensor(tokenizer.encode("Hello, my dog is cute")).unsqueeze(0) # Batch size 1
input_ids = torch.tensor(tokenizer.encode("Hello, my dog is cute")).unsqueeze(0) # Batch size 1
>>>
outputs = model(input_ids)
outputs = model(input_ids)
>>>
prediction_scores, mems = outputs[:2]
prediction_scores, mems = outputs[:2]
"""
"""
def
__init__
(
self
,
config
):
def
__init__
(
self
,
config
):
...
...
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