Commit ea89bec1 authored by Aymeric Augustin's avatar Aymeric Augustin
Browse files

Fix E231 flake8 warning (x9).

parent fd2f17a7
...@@ -130,7 +130,7 @@ class HfApi: ...@@ -130,7 +130,7 @@ class HfApi:
pf = TqdmProgressFileReader(f) pf = TqdmProgressFileReader(f)
data = f if pf.total_size > 0 else "" 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() r.raise_for_status()
pf.close() pf.close()
return urls.access return urls.access
......
...@@ -158,9 +158,7 @@ class AdamWeightDecay(tf.keras.optimizers.Adam): ...@@ -158,9 +158,7 @@ class AdamWeightDecay(tf.keras.optimizers.Adam):
def get_config(self): def get_config(self):
config = super(AdamWeightDecay, self).get_config() config = super(AdamWeightDecay, self).get_config()
config.update( config.update({"weight_decay_rate": self.weight_decay_rate})
{"weight_decay_rate": self.weight_decay_rate,}
)
return config return config
def _do_use_weight_decay(self, param_name): def _do_use_weight_decay(self, param_name):
......
...@@ -836,7 +836,7 @@ SUPPORTED_TASKS = { ...@@ -836,7 +836,7 @@ SUPPORTED_TASKS = {
"tf": TFAutoModel if is_tf_available() else None, "tf": TFAutoModel if is_tf_available() else None,
"pt": AutoModel if is_torch_available() else None, "pt": AutoModel if is_torch_available() else None,
"default": { "default": {
"model": {"pt": "distilbert-base-uncased", "tf": "distilbert-base-uncased",}, "model": {"pt": "distilbert-base-uncased", "tf": "distilbert-base-uncased"},
"config": None, "config": None,
"tokenizer": "distilbert-base-uncased", "tokenizer": "distilbert-base-uncased",
}, },
......
...@@ -34,14 +34,14 @@ class ModelCardTester(unittest.TestCase): ...@@ -34,14 +34,14 @@ class ModelCardTester(unittest.TestCase):
}, },
"metrics": "BLEU and ROUGE-1", "metrics": "BLEU and ROUGE-1",
"evaluation_data": { "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", "Preprocessing": "See details on https://arxiv.org/pdf/1810.03993.pdf",
}, },
"training_data": { "training_data": {
"Dataset": "English Wikipedia dump dated 2018-12-01", "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", "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): def test_model_card_common_properties(self):
......
...@@ -33,8 +33,8 @@ VOCAB_FILES_NAMES = { ...@@ -33,8 +33,8 @@ VOCAB_FILES_NAMES = {
} }
PRETRAINED_VOCAB_FILES_MAP = { PRETRAINED_VOCAB_FILES_MAP = {
"vocab_file": {"ctrl": "https://raw.githubusercontent.com/salesforce/ctrl/master/ctrl-vocab.json",}, "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",}, "merges_file": {"ctrl": "https://raw.githubusercontent.com/salesforce/ctrl/master/ctrl-merges.txt"},
} }
PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = {
......
...@@ -33,8 +33,8 @@ VOCAB_FILES_NAMES = { ...@@ -33,8 +33,8 @@ VOCAB_FILES_NAMES = {
} }
PRETRAINED_VOCAB_FILES_MAP = { PRETRAINED_VOCAB_FILES_MAP = {
"vocab_file": {"openai-gpt": "https://s3.amazonaws.com/models.huggingface.co/bert/openai-gpt-vocab.json",}, "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",}, "merges_file": {"openai-gpt": "https://s3.amazonaws.com/models.huggingface.co/bert/openai-gpt-merges.txt"},
} }
PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = { PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment