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
7df303f5
Commit
7df303f5
authored
Aug 08, 2019
by
LysandreJik
Browse files
fix #971
parent
7729ef73
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
6 deletions
+6
-6
pytorch_transformers/modeling_bert.py
pytorch_transformers/modeling_bert.py
+1
-1
pytorch_transformers/modeling_gpt2.py
pytorch_transformers/modeling_gpt2.py
+2
-2
pytorch_transformers/modeling_openai.py
pytorch_transformers/modeling_openai.py
+2
-2
pytorch_transformers/modeling_xlm.py
pytorch_transformers/modeling_xlm.py
+1
-1
No files found.
pytorch_transformers/modeling_bert.py
View file @
7df303f5
...
@@ -603,7 +603,7 @@ BERT_INPUTS_DOCSTRING = r"""
...
@@ -603,7 +603,7 @@ BERT_INPUTS_DOCSTRING = r"""
:func:`pytorch_transformers.PreTrainedTokenizer.convert_tokens_to_ids` for details.
:func:`pytorch_transformers.PreTrainedTokenizer.convert_tokens_to_ids` for details.
**position_ids**: (`optional`) ``torch.LongTensor`` of shape ``(batch_size, sequence_length)``:
**position_ids**: (`optional`) ``torch.LongTensor`` of shape ``(batch_size, sequence_length)``:
Indices of positions of each input sequence tokens in the position embeddings.
Indices of positions of each input sequence tokens in the position embeddings.
Selected in the range ``[0, config.max_position_embeddings - 1
[
``.
Selected in the range ``[0, config.max_position_embeddings - 1
]
``.
**token_type_ids**: (`optional`) ``torch.LongTensor`` of shape ``(batch_size, sequence_length)``:
**token_type_ids**: (`optional`) ``torch.LongTensor`` of shape ``(batch_size, sequence_length)``:
Segment token indices to indicate first and second portions of the inputs.
Segment token indices to indicate first and second portions of the inputs.
Indices are selected in ``[0, 1]``: ``0`` corresponds to a `sentence A` token, ``1``
Indices are selected in ``[0, 1]``: ``0`` corresponds to a `sentence A` token, ``1``
...
...
pytorch_transformers/modeling_gpt2.py
View file @
7df303f5
...
@@ -393,7 +393,7 @@ GPT2_INPUTS_DOCSTRING = r""" Inputs:
...
@@ -393,7 +393,7 @@ GPT2_INPUTS_DOCSTRING = r""" Inputs:
:func:`pytorch_transformers.PreTrainedTokenizer.convert_tokens_to_ids` for details.
:func:`pytorch_transformers.PreTrainedTokenizer.convert_tokens_to_ids` for details.
**position_ids**: (`optional`) ``torch.LongTensor`` of shape ``(batch_size, sequence_length)``:
**position_ids**: (`optional`) ``torch.LongTensor`` of shape ``(batch_size, sequence_length)``:
Indices of positions of each input sequence tokens in the position embeddings.
Indices of positions of each input sequence tokens in the position embeddings.
Selected in the range ``[0, config.max_position_embeddings - 1
[
``.
Selected in the range ``[0, config.max_position_embeddings - 1
]
``.
**token_type_ids**: (`optional`) ``torch.LongTensor`` of shape ``(batch_size, sequence_length)``:
**token_type_ids**: (`optional`) ``torch.LongTensor`` of shape ``(batch_size, sequence_length)``:
A parallel sequence of tokens (can be used to indicate various portions of the inputs).
A parallel sequence of tokens (can be used to indicate various portions of the inputs).
The embeddings from these tokens will be summed with the respective token embeddings.
The embeddings from these tokens will be summed with the respective token embeddings.
...
@@ -627,7 +627,7 @@ class GPT2DoubleHeadsModel(GPT2PreTrainedModel):
...
@@ -627,7 +627,7 @@ class GPT2DoubleHeadsModel(GPT2PreTrainedModel):
Selected in the range ``[0, input_ids.size(-1) - 1[``.
Selected in the range ``[0, input_ids.size(-1) - 1[``.
**position_ids**: (`optional`) ``torch.LongTensor`` of shape ``(batch_size, num_choices, sequence_length)``:
**position_ids**: (`optional`) ``torch.LongTensor`` of shape ``(batch_size, num_choices, sequence_length)``:
Indices of positions of each input sequence tokens in the position embeddings.
Indices of positions of each input sequence tokens in the position embeddings.
Selected in the range ``[0, config.max_position_embeddings - 1
[
``.
Selected in the range ``[0, config.max_position_embeddings - 1
]
``.
**token_type_ids**: (`optional`) ``torch.LongTensor`` of shape ``(batch_size, num_choices, sequence_length)``:
**token_type_ids**: (`optional`) ``torch.LongTensor`` of shape ``(batch_size, num_choices, sequence_length)``:
A parallel sequence of tokens (can be used to indicate various portions of the inputs).
A parallel sequence of tokens (can be used to indicate various portions of the inputs).
The embeddings from these tokens will be summed with the respective token embeddings.
The embeddings from these tokens will be summed with the respective token embeddings.
...
...
pytorch_transformers/modeling_openai.py
View file @
7df303f5
...
@@ -407,7 +407,7 @@ OPENAI_GPT_INPUTS_DOCSTRING = r""" Inputs:
...
@@ -407,7 +407,7 @@ OPENAI_GPT_INPUTS_DOCSTRING = r""" Inputs:
:func:`pytorch_transformers.PreTrainedTokenizer.convert_tokens_to_ids` for details.
:func:`pytorch_transformers.PreTrainedTokenizer.convert_tokens_to_ids` for details.
**position_ids**: (`optional`) ``torch.LongTensor`` of shape ``(batch_size, sequence_length)``:
**position_ids**: (`optional`) ``torch.LongTensor`` of shape ``(batch_size, sequence_length)``:
Indices of positions of each input sequence tokens in the position embeddings.
Indices of positions of each input sequence tokens in the position embeddings.
Selected in the range ``[0, config.max_position_embeddings - 1
[
``.
Selected in the range ``[0, config.max_position_embeddings - 1
]
``.
**token_type_ids**: (`optional`) ``torch.LongTensor`` of shape ``(batch_size, sequence_length)``:
**token_type_ids**: (`optional`) ``torch.LongTensor`` of shape ``(batch_size, sequence_length)``:
A parallel sequence of tokens (can be used to indicate various portions of the inputs).
A parallel sequence of tokens (can be used to indicate various portions of the inputs).
The embeddings from these tokens will be summed with the respective token embeddings.
The embeddings from these tokens will be summed with the respective token embeddings.
...
@@ -617,7 +617,7 @@ class OpenAIGPTDoubleHeadsModel(OpenAIGPTPreTrainedModel):
...
@@ -617,7 +617,7 @@ class OpenAIGPTDoubleHeadsModel(OpenAIGPTPreTrainedModel):
Selected in the range ``[0, input_ids.size(-1) - 1[``.
Selected in the range ``[0, input_ids.size(-1) - 1[``.
**position_ids**: (`optional`) ``torch.LongTensor`` of shape ``(batch_size, num_choices, sequence_length)``:
**position_ids**: (`optional`) ``torch.LongTensor`` of shape ``(batch_size, num_choices, sequence_length)``:
Indices of positions of each input sequence tokens in the position embeddings.
Indices of positions of each input sequence tokens in the position embeddings.
Selected in the range ``[0, config.max_position_embeddings - 1
[
``.
Selected in the range ``[0, config.max_position_embeddings - 1
]
``.
**token_type_ids**: (`optional`) ``torch.LongTensor`` of shape ``(batch_size, num_choices, sequence_length)``:
**token_type_ids**: (`optional`) ``torch.LongTensor`` of shape ``(batch_size, num_choices, sequence_length)``:
A parallel sequence of tokens (can be used to indicate various portions of the inputs).
A parallel sequence of tokens (can be used to indicate various portions of the inputs).
The embeddings from these tokens will be summed with the respective token embeddings.
The embeddings from these tokens will be summed with the respective token embeddings.
...
...
pytorch_transformers/modeling_xlm.py
View file @
7df303f5
...
@@ -427,7 +427,7 @@ XLM_INPUTS_DOCSTRING = r"""
...
@@ -427,7 +427,7 @@ XLM_INPUTS_DOCSTRING = r"""
:func:`pytorch_transformers.PreTrainedTokenizer.convert_tokens_to_ids` for details.
:func:`pytorch_transformers.PreTrainedTokenizer.convert_tokens_to_ids` for details.
**position_ids**: (`optional`) ``torch.LongTensor`` of shape ``(batch_size, sequence_length)``:
**position_ids**: (`optional`) ``torch.LongTensor`` of shape ``(batch_size, sequence_length)``:
Indices of positions of each input sequence tokens in the position embeddings.
Indices of positions of each input sequence tokens in the position embeddings.
Selected in the range ``[0, config.max_position_embeddings - 1
[
``.
Selected in the range ``[0, config.max_position_embeddings - 1
]
``.
**token_type_ids**: (`optional`) ``torch.LongTensor`` of shape ``(batch_size, sequence_length)``:
**token_type_ids**: (`optional`) ``torch.LongTensor`` of shape ``(batch_size, sequence_length)``:
A parallel sequence of tokens (can be used to indicate various portions of the inputs).
A parallel sequence of tokens (can be used to indicate various portions of the inputs).
The embeddings from these tokens will be summed with the respective token embeddings.
The embeddings from these tokens will be summed with the respective token embeddings.
...
...
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