From be2d229dac4dc4640eb62e4b5ff198ee63fe68b2 Mon Sep 17 00:00:00 2001 From: fabiocapsouza Date: Sun, 15 Nov 2020 12:30:46 -0300 Subject: [PATCH] Revert "Fixing some warnings in DeBerta (#8176)" This reverts commit 6fcadfd140f95ab8570697e1f7cdf16c9545f4ec. --- src/transformers/modeling_deberta.py | 4 ++-- src/transformers/tokenization_deberta.py | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/transformers/modeling_deberta.py b/src/transformers/modeling_deberta.py index c5ad2fd821d9cf..a05b65e3953f20 100644 --- a/src/transformers/modeling_deberta.py +++ b/src/transformers/modeling_deberta.py @@ -15,7 +15,7 @@ """ PyTorch DeBERTa model. """ import math -from collections.abc import Sequence +from collections import Sequence import torch from packaging import version @@ -480,7 +480,7 @@ class DisentangledSelfAttention(torch.nn.Module): Parameters: config (:obj:`str`): A model config class instance with the configuration to build a new model. The schema is similar to - `BertConfig`, for more details, please refer :class:`~transformers.DebertaConfig` + `BertConfig`, \ for more details, please refer :class:`~transformers.DebertaConfig` """ diff --git a/src/transformers/tokenization_deberta.py b/src/transformers/tokenization_deberta.py index 18bad354c59d02..c12c7a2734c7d0 100644 --- a/src/transformers/tokenization_deberta.py +++ b/src/transformers/tokenization_deberta.py @@ -297,15 +297,15 @@ class GPT2Tokenizer(object): Args: vocab_file (:obj:`str`, optional): The local path of vocabulary package or the release name of vocabulary in `DeBERTa GitHub releases - `_, e.g. "bpe_encoder", default: `None`. + `_, \ e.g. "bpe_encoder", default: `None`. If it's `None`, then it will download the vocabulary in the latest release from GitHub. The vocabulary file - is a state dictionary with three items, "dict_map", "vocab", "encoder" which correspond to three files used - in `RoBERTa`, i.e. `dict.txt`, `vocab.txt` and `encoder.json`. The difference between our wrapped GPT2 - tokenizer and RoBERTa wrapped tokenizer are, + is a \ state dictionary with three items, "dict_map", "vocab", "encoder" which correspond to three files + used in `RoBERTa`, i.e. `dict.txt`, `vocab.txt` and `encoder.json`. \ The difference between our wrapped + GPT2 tokenizer and RoBERTa wrapped tokenizer are, - Special tokens, unlike `RoBERTa` which use ``, `` as the `start` token and `end` token of a - sentence. We use `[CLS]` and `[SEP]` as the `start` and `end` token of input sentence which is the same + sentence. We use `[CLS]` and `[SEP]` as the `start` and `end`\ token of input sentence which is the same as `BERT`. - We remapped the token ids in our dictionary with regarding to the new special tokens, `[PAD]` => 0,