mirror of
https://github.com/huggingface/transformers.git
synced 2025-08-02 19:21:31 +06:00
Fix E231 flake8 warning (x9).
This commit is contained in:
parent
fd2f17a7a1
commit
ea89bec185
@ -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
|
||||
|
@ -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):
|
||||
|
@ -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",
|
||||
},
|
||||
|
@ -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):
|
||||
|
@ -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 = {
|
||||
|
@ -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 = {
|
||||
|
Loading…
Reference in New Issue
Block a user