Fix E231 flake8 warning (x9).

This commit is contained in:
Aymeric Augustin 2019-12-21 18:13:15 +01:00
parent fd2f17a7a1
commit ea89bec185
6 changed files with 9 additions and 11 deletions

View File

@ -130,7 +130,7 @@ class HfApi:
pf = TqdmProgressFileReader(f)
data = f if pf.total_size > 0 else ""
r = requests.put(urls.write, data=data, headers={"content-type": urls.type,})
r = requests.put(urls.write, data=data, headers={"content-type": urls.type})
r.raise_for_status()
pf.close()
return urls.access

View File

@ -158,9 +158,7 @@ class AdamWeightDecay(tf.keras.optimizers.Adam):
def get_config(self):
config = super(AdamWeightDecay, self).get_config()
config.update(
{"weight_decay_rate": self.weight_decay_rate,}
)
config.update({"weight_decay_rate": self.weight_decay_rate})
return config
def _do_use_weight_decay(self, param_name):

View File

@ -836,7 +836,7 @@ SUPPORTED_TASKS = {
"tf": TFAutoModel if is_tf_available() else None,
"pt": AutoModel if is_torch_available() else None,
"default": {
"model": {"pt": "distilbert-base-uncased", "tf": "distilbert-base-uncased",},
"model": {"pt": "distilbert-base-uncased", "tf": "distilbert-base-uncased"},
"config": None,
"tokenizer": "distilbert-base-uncased",
},

View File

@ -34,14 +34,14 @@ class ModelCardTester(unittest.TestCase):
},
"metrics": "BLEU and ROUGE-1",
"evaluation_data": {
"Datasets": {"BLEU": "My-great-dataset-v1", "ROUGE-1": "My-short-dataset-v2.1",},
"Datasets": {"BLEU": "My-great-dataset-v1", "ROUGE-1": "My-short-dataset-v2.1"},
"Preprocessing": "See details on https://arxiv.org/pdf/1810.03993.pdf",
},
"training_data": {
"Dataset": "English Wikipedia dump dated 2018-12-01",
"Preprocessing": "Using SentencePiece vocabulary of size 52k tokens. See details on https://arxiv.org/pdf/1810.03993.pdf",
},
"quantitative_analyses": {"BLEU": 55.1, "ROUGE-1": 76,},
"quantitative_analyses": {"BLEU": 55.1, "ROUGE-1": 76},
}
def test_model_card_common_properties(self):

View File

@ -33,8 +33,8 @@ VOCAB_FILES_NAMES = {
}
PRETRAINED_VOCAB_FILES_MAP = {
"vocab_file": {"ctrl": "https://raw.githubusercontent.com/salesforce/ctrl/master/ctrl-vocab.json",},
"merges_file": {"ctrl": "https://raw.githubusercontent.com/salesforce/ctrl/master/ctrl-merges.txt",},
"vocab_file": {"ctrl": "https://raw.githubusercontent.com/salesforce/ctrl/master/ctrl-vocab.json"},
"merges_file": {"ctrl": "https://raw.githubusercontent.com/salesforce/ctrl/master/ctrl-merges.txt"},
}
PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = {

View File

@ -33,8 +33,8 @@ VOCAB_FILES_NAMES = {
}
PRETRAINED_VOCAB_FILES_MAP = {
"vocab_file": {"openai-gpt": "https://s3.amazonaws.com/models.huggingface.co/bert/openai-gpt-vocab.json",},
"merges_file": {"openai-gpt": "https://s3.amazonaws.com/models.huggingface.co/bert/openai-gpt-merges.txt",},
"vocab_file": {"openai-gpt": "https://s3.amazonaws.com/models.huggingface.co/bert/openai-gpt-vocab.json"},
"merges_file": {"openai-gpt": "https://s3.amazonaws.com/models.huggingface.co/bert/openai-gpt-merges.txt"},
}
PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = {