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
01977466
Unverified
Commit
01977466
authored
Aug 30, 2021
by
arfy slowy
Committed by
GitHub
Aug 30, 2021
Browse files
fix: typo spelling grammar (#13212)
* fix: typo spelling grammar * fix: make fixup
parent
ef83dc4f
Changes
24
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
27 additions
and
27 deletions
+27
-27
docs/source/main_classes/trainer.rst
docs/source/main_classes/trainer.rst
+1
-1
docs/source/model_doc/deberta_v2.rst
docs/source/model_doc/deberta_v2.rst
+1
-1
docs/source/model_doc/speech_to_text.rst
docs/source/model_doc/speech_to_text.rst
+2
-2
docs/source/training.rst
docs/source/training.rst
+1
-1
src/transformers/deepspeed.py
src/transformers/deepspeed.py
+1
-1
src/transformers/modelcard.py
src/transformers/modelcard.py
+1
-1
src/transformers/modeling_flax_utils.py
src/transformers/modeling_flax_utils.py
+2
-2
src/transformers/modeling_tf_utils.py
src/transformers/modeling_tf_utils.py
+2
-2
src/transformers/modeling_utils.py
src/transformers/modeling_utils.py
+2
-2
src/transformers/models/big_bird/modeling_big_bird.py
src/transformers/models/big_bird/modeling_big_bird.py
+1
-1
src/transformers/models/bigbird_pegasus/modeling_bigbird_pegasus.py
...ormers/models/bigbird_pegasus/modeling_bigbird_pegasus.py
+1
-1
src/transformers/models/clip/tokenization_clip.py
src/transformers/models/clip/tokenization_clip.py
+2
-2
src/transformers/models/detr/modeling_detr.py
src/transformers/models/detr/modeling_detr.py
+3
-3
src/transformers/models/encoder_decoder/modeling_encoder_decoder.py
...ormers/models/encoder_decoder/modeling_encoder_decoder.py
+1
-1
src/transformers/models/gpt_neo/configuration_gpt_neo.py
src/transformers/models/gpt_neo/configuration_gpt_neo.py
+1
-1
src/transformers/models/hubert/modeling_hubert.py
src/transformers/models/hubert/modeling_hubert.py
+1
-1
src/transformers/models/rag/modeling_rag.py
src/transformers/models/rag/modeling_rag.py
+1
-1
src/transformers/models/rag/modeling_tf_rag.py
src/transformers/models/rag/modeling_tf_rag.py
+1
-1
src/transformers/models/wav2vec2/modeling_flax_wav2vec2.py
src/transformers/models/wav2vec2/modeling_flax_wav2vec2.py
+1
-1
src/transformers/models/wav2vec2/modeling_wav2vec2.py
src/transformers/models/wav2vec2/modeling_wav2vec2.py
+1
-1
No files found.
docs/source/main_classes/trainer.rst
View file @
01977466
...
...
@@ -197,7 +197,7 @@ which should make the "stop and resume" style of training as close as possible t
However, due to various default non-deterministic pytorch settings this might not fully work. If you want full
determinism please refer to `Controlling sources of randomness
<https://pytorch.org/docs/stable/notes/randomness.html>`__. As explained in the document, that some of those settings
that make things determinstic (.e.g., ``torch.backends.cudnn.deterministic``) may slow things down, therefore this
that make things determin
i
stic (.e.g., ``torch.backends.cudnn.deterministic``) may slow things down, therefore this
can't be done by default, but you can enable those yourself if needed.
...
...
docs/source/model_doc/deberta_v2.rst
View file @
01977466
...
...
@@ -53,7 +53,7 @@ New in v2:
transformer layer to better learn the local dependency of input tokens.
- **Sharing position projection matrix with content projection matrix in attention layer** Based on previous
experiments, this can save parameters without affecting the performance.
- **Apply bucket to encode relative postions** The DeBERTa-v2 model uses log bucket to encode relative positions
- **Apply bucket to encode relative pos
i
tions** The DeBERTa-v2 model uses log bucket to encode relative positions
similar to T5.
- **900M model & 1.5B model** Two additional model sizes are available: 900M and 1.5B, which significantly improves the
performance of downstream tasks.
...
...
docs/source/model_doc/speech_to_text.rst
View file @
01977466
...
...
@@ -42,8 +42,8 @@ features. The :class:`~transformers.Speech2TextProcessor` wraps :class:`~transfo
predicted token ids.
The feature extractor depends on :obj:`torchaudio` and the tokenizer depends on :obj:`sentencepiece` so be sure to
install those packages before running the examples. You could either install those as extra speech depend
a
ncies with
``pip install transformers"[speech, sentencepiece]"`` or install the packages seperatly with ``pip install torchaudio
install those packages before running the examples. You could either install those as extra speech depend
e
ncies with
``pip install transformers"[speech, sentencepiece]"`` or install the packages seperat
e
ly with ``pip install torchaudio
sentencepiece``. Also ``torchaudio`` requires the development version of the `libsndfile
<http://www.mega-nerd.com/libsndfile/>`__ package which can be installed via a system package manager. On Ubuntu it can
be installed as follows: ``apt install libsndfile1-dev``
...
...
docs/source/training.rst
View file @
01977466
...
...
@@ -281,7 +281,7 @@ Fine-tuning in native PyTorch
frameborder
=
"0"
allow
=
"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope;
picture-in-picture"
allowfullscreen
></
iframe
>
You
might
need
to
restart
your
notebook
at
this
stage
to
free
some
memory
,
or
excute
the
following
code
:
You
might
need
to
restart
your
notebook
at
this
stage
to
free
some
memory
,
or
ex
e
cute
the
following
code
:
..
code
-
block
::
python
...
...
src/transformers/deepspeed.py
View file @
01977466
...
...
@@ -62,7 +62,7 @@ class HfDeepSpeedConfig:
if
isinstance
(
config_file_or_dict
,
dict
):
# Don't modify user's data should they want to reuse it (e.g. in tests), because once we
# modified it, it will not be accepted here again, since `auto` values would have been overriden
# modified it, it will not be accepted here again, since `auto` values would have been overrid
d
en
config
=
deepcopy
(
config_file_or_dict
)
elif
isinstance
(
config_file_or_dict
,
str
):
with
io
.
open
(
config_file_or_dict
,
"r"
,
encoding
=
"utf-8"
)
as
f
:
...
...
src/transformers/modelcard.py
View file @
01977466
...
...
@@ -468,7 +468,7 @@ class TrainingSummary:
model_card
+=
f
"This model is a fine-tuned version of [
{
self
.
finetuned_from
}
](https://huggingface.co/
{
self
.
finetuned_from
}
) on "
if
self
.
dataset
is
None
:
model_card
+=
"an unkown dataset."
model_card
+=
"an unk
n
own dataset."
else
:
if
isinstance
(
self
.
dataset
,
str
):
model_card
+=
f
"the
{
self
.
dataset
}
dataset."
...
...
src/transformers/modeling_flax_utils.py
View file @
01977466
...
...
@@ -177,14 +177,14 @@ class FlaxPreTrainedModel(PushToHubMixin, FlaxGenerationMixin):
- A path or url to a `pt index checkpoint file` (e.g, ``./tf_model/model.ckpt.index``). In this
case, ``from_pt`` should be set to :obj:`True`.
model_args (sequence of positional arguments, `optional`):
All remaning positional arguments will be passed to the underlying model's ``__init__`` method.
All rema
i
ning positional arguments will be passed to the underlying model's ``__init__`` method.
config (:obj:`Union[PretrainedConfig, str, os.PathLike]`, `optional`):
Can be either:
- an instance of a class derived from :class:`~transformers.PretrainedConfig`,
- a string or path valid as input to :func:`~transformers.PretrainedConfig.from_pretrained`.
Configuration for the model to use instead of an automatically loaded configuation. Configuration can
Configuration for the model to use instead of an automatically loaded configu
r
ation. Configuration can
be automatically loaded when:
- The model is a model provided by the library (loaded with the `model id` string of a pretrained
...
...
src/transformers/modeling_tf_utils.py
View file @
01977466
...
...
@@ -1120,14 +1120,14 @@ class TFPreTrainedModel(tf.keras.Model, TFModelUtilsMixin, TFGenerationMixin, Pu
- :obj:`None` if you are both providing the configuration and state dictionary (resp. with keyword
arguments ``config`` and ``state_dict``).
model_args (sequence of positional arguments, `optional`):
All remaning positional arguments will be passed to the underlying model's ``__init__`` method.
All rema
i
ning positional arguments will be passed to the underlying model's ``__init__`` method.
config (:obj:`Union[PretrainedConfig, str]`, `optional`):
Can be either:
- an instance of a class derived from :class:`~transformers.PretrainedConfig`,
- a string valid as input to :func:`~transformers.PretrainedConfig.from_pretrained`.
Configuration for the model to use instead of an automatically loaded configuation. Configuration can
Configuration for the model to use instead of an automatically loaded configu
r
ation. Configuration can
be automatically loaded when:
- The model is a model provided by the library (loaded with the `model id` string of a pretrained
...
...
src/transformers/modeling_utils.py
View file @
01977466
...
...
@@ -1038,14 +1038,14 @@ class PreTrainedModel(nn.Module, ModuleUtilsMixin, GenerationMixin, PushToHubMix
- :obj:`None` if you are both providing the configuration and state dictionary (resp. with keyword
arguments ``config`` and ``state_dict``).
model_args (sequence of positional arguments, `optional`):
All remaning positional arguments will be passed to the underlying model's ``__init__`` method.
All rema
i
ning positional arguments will be passed to the underlying model's ``__init__`` method.
config (:obj:`Union[PretrainedConfig, str, os.PathLike]`, `optional`):
Can be either:
- an instance of a class derived from :class:`~transformers.PretrainedConfig`,
- a string or path valid as input to :func:`~transformers.PretrainedConfig.from_pretrained`.
Configuration for the model to use instead of an automatically loaded configuation. Configuration can
Configuration for the model to use instead of an automatically loaded configu
r
ation. Configuration can
be automatically loaded when:
- The model is a model provided by the library (loaded with the `model id` string of a pretrained
...
...
src/transformers/models/big_bird/modeling_big_bird.py
View file @
01977466
...
...
@@ -1138,7 +1138,7 @@ class BigBirdBlockSparseAttention(nn.Module):
from_block_size: int. size of block in from sequence.
to_block_size: int. size of block in to sequence.
num_heads: int. total number of heads.
plan_from_length: list. plan from length where num_random_blocks are cho
o
sen from.
plan_from_length: list. plan from length where num_random_blocks are chosen from.
plan_num_rand_blocks: list. number of rand blocks within the plan.
window_block_left: int. number of blocks of window to left of a block.
window_block_right: int. number of blocks of window to right of a block.
...
...
src/transformers/models/bigbird_pegasus/modeling_bigbird_pegasus.py
View file @
01977466
...
...
@@ -952,7 +952,7 @@ class BigBirdPegasusBlockSparseAttention(nn.Module):
from_block_size: int. size of block in from sequence.
to_block_size: int. size of block in to sequence.
num_heads: int. total number of heads.
plan_from_length: list. plan from length where num_random_blocks are cho
o
sen from.
plan_from_length: list. plan from length where num_random_blocks are chosen from.
plan_num_rand_blocks: list. number of rand blocks within the plan.
window_block_left: int. number of blocks of window to left of a block.
window_block_right: int. number of blocks of window to right of a block.
...
...
src/transformers/models/clip/tokenization_clip.py
View file @
01977466
...
...
@@ -60,7 +60,7 @@ def bytes_to_unicode():
The reversible bpe codes work on unicode strings. This means you need a large # of unicode characters in your vocab
if you want to avoid UNKs. When you're at something like a 10B token dataset you end up needing around 5K for
decent coverage. This is a signficant percentage of your normal, say, 32K bpe vocab. To avoid that, we want lookup
decent coverage. This is a sign
i
ficant percentage of your normal, say, 32K bpe vocab. To avoid that, we want lookup
tables between utf-8 bytes and unicode strings.
"""
bs
=
(
...
...
@@ -317,7 +317,7 @@ class CLIPTokenizer(PreTrainedTokenizer):
for
token
in
re
.
findall
(
self
.
pat
,
text
):
token
=
""
.
join
(
self
.
byte_encoder
[
b
]
for
b
in
token
.
encode
(
"utf-8"
)
)
# Maps all our bytes to unicode strings, avoiding control
e
tokens of the BPE (spaces in our case)
)
# Maps all our bytes to unicode strings, avoiding control tokens of the BPE (spaces in our case)
bpe_tokens
.
extend
(
bpe_token
for
bpe_token
in
self
.
bpe
(
token
).
split
(
" "
))
return
bpe_tokens
...
...
src/transformers/models/detr/modeling_detr.py
View file @
01977466
...
...
@@ -151,7 +151,7 @@ class DetrObjectDetectionOutput(ModelOutput):
unnormalized bounding boxes.
auxiliary_outputs (:obj:`list[Dict]`, `optional`):
Optional, only returned when auxilary losses are activated (i.e. :obj:`config.auxiliary_loss` is set to
`True`) and labels are provided. It is a list of diction
n
aries containing the two above keys (:obj:`logits`
`True`) and labels are provided. It is a list of dictionaries containing the two above keys (:obj:`logits`
and :obj:`pred_boxes`) for each decoder layer.
last_hidden_state (:obj:`torch.FloatTensor` of shape :obj:`(batch_size, sequence_length, hidden_size)`, `optional`):
Sequence of hidden-states at the output of the last layer of the decoder of the model.
...
...
@@ -218,8 +218,8 @@ class DetrSegmentationOutput(ModelOutput):
:meth:`~transformers.DetrFeatureExtractor.post_process_panoptic` to evaluate instance and panoptic
segmentation masks respectively.
auxiliary_outputs (:obj:`list[Dict]`, `optional`):
Optional, only returned when auxilary losses are activated (i.e. :obj:`config.auxiliary_loss` is set to
`True`) and labels are provided. It is a list of diction
n
aries containing the two above keys (:obj:`logits`
Optional, only returned when auxil
i
ary losses are activated (i.e. :obj:`config.auxiliary_loss` is set to
`True`) and labels are provided. It is a list of dictionaries containing the two above keys (:obj:`logits`
and :obj:`pred_boxes`) for each decoder layer.
last_hidden_state (:obj:`torch.FloatTensor` of shape :obj:`(batch_size, sequence_length, hidden_size)`, `optional`):
Sequence of hidden-states at the output of the last layer of the decoder of the model.
...
...
src/transformers/models/encoder_decoder/modeling_encoder_decoder.py
View file @
01977466
...
...
@@ -272,7 +272,7 @@ class EncoderDecoderModel(PreTrainedModel):
a PyTorch model using the provided conversion scripts and loading the PyTorch model afterwards.
model_args (remaining positional arguments, `optional`):
All remaning positional arguments will be passed to the underlying model's ``__init__`` method.
All rema
i
ning positional arguments will be passed to the underlying model's ``__init__`` method.
kwargs (remaining dictionary of keyword arguments, `optional`):
Can be used to update the configuration object (after it being loaded) and initiate the model (e.g.,
...
...
src/transformers/models/gpt_neo/configuration_gpt_neo.py
View file @
01977466
...
...
@@ -205,7 +205,7 @@ def custom_unfold(input, dimension, size, step):
def
custom_get_block_length_and_num_blocks
(
seq_length
,
window_size
):
"""
Custom implementation for GPTNeoAttentionMixin._get_block_length_and_num_blocks to enable the export to ONNX as
original implmentation uses Python variables and control flow.
original impl
e
mentation uses Python variables and control flow.
"""
import
torch
...
...
src/transformers/models/hubert/modeling_hubert.py
View file @
01977466
...
...
@@ -237,7 +237,7 @@ class HubertSamePadLayer(nn.Module):
# Copied from transformers.models.wav2vec2.modeling_wav2vec2.Wav2Vec2FeatureExtractor with Wav2Vec2->Hubert
class
HubertFeatureExtractor
(
nn
.
Module
):
"""Construct the featurs from raw audio waveform"""
"""Construct the featur
e
s from raw audio waveform"""
def
__init__
(
self
,
config
):
super
().
__init__
()
...
...
src/transformers/models/rag/modeling_rag.py
View file @
01977466
...
...
@@ -283,7 +283,7 @@ class RagPreTrainedModel(PreTrainedModel):
a PyTorch model using the provided conversion scripts and loading the PyTorch model afterwards.
model_args (remaining positional arguments, `optional`):
All remaning positional arguments will be passed to the underlying model's ``__init__`` method.
All rema
i
ning positional arguments will be passed to the underlying model's ``__init__`` method.
retriever (:class:`~transformers.RagRetriever`, `optional`):
The retriever to use.
kwwargs (remaining dictionary of keyword arguments, `optional`):
...
...
src/transformers/models/rag/modeling_tf_rag.py
View file @
01977466
...
...
@@ -258,7 +258,7 @@ class TFRagPreTrainedModel(TFPreTrainedModel):
``generator_from_pt`` should be set to :obj:`True`.
model_args (remaining positional arguments, `optional`):
All remaning positional arguments will be passed to the underlying model's ``__init__`` method.
All rema
i
ning positional arguments will be passed to the underlying model's ``__init__`` method.
retriever (:class:`~transformers.RagRetriever`, `optional`):
The retriever to use.
kwargs (remaining dictionary of keyword arguments, `optional`):
...
...
src/transformers/models/wav2vec2/modeling_flax_wav2vec2.py
View file @
01977466
...
...
@@ -385,7 +385,7 @@ class FlaxConvLayersCollection(nn.Module):
class
FlaxWav2Vec2FeatureExtractor
(
nn
.
Module
):
"""Construct the featurs from raw audio waveform"""
"""Construct the featur
e
s from raw audio waveform"""
config
:
Wav2Vec2Config
dtype
:
jnp
.
dtype
=
jnp
.
float32
...
...
src/transformers/models/wav2vec2/modeling_wav2vec2.py
View file @
01977466
...
...
@@ -308,7 +308,7 @@ class Wav2Vec2SamePadLayer(nn.Module):
class
Wav2Vec2FeatureExtractor
(
nn
.
Module
):
"""Construct the featurs from raw audio waveform"""
"""Construct the featur
e
s from raw audio waveform"""
def
__init__
(
self
,
config
):
super
().
__init__
()
...
...
Prev
1
2
Next
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