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
ea89bec1
Commit
ea89bec1
authored
Dec 21, 2019
by
Aymeric Augustin
Browse files
Fix E231 flake8 warning (x9).
parent
fd2f17a7
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
9 additions
and
11 deletions
+9
-11
transformers/hf_api.py
transformers/hf_api.py
+1
-1
transformers/optimization_tf.py
transformers/optimization_tf.py
+1
-3
transformers/pipelines.py
transformers/pipelines.py
+1
-1
transformers/tests/model_card_test.py
transformers/tests/model_card_test.py
+2
-2
transformers/tokenization_ctrl.py
transformers/tokenization_ctrl.py
+2
-2
transformers/tokenization_openai.py
transformers/tokenization_openai.py
+2
-2
No files found.
transformers/hf_api.py
View file @
ea89bec1
...
...
@@ -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
...
...
transformers/optimization_tf.py
View file @
ea89bec1
...
...
@@ -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
):
...
...
transformers/pipelines.py
View file @
ea89bec1
...
...
@@ -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"
,
},
...
...
transformers/tests/model_card_test.py
View file @
ea89bec1
...
...
@@ -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
):
...
...
transformers/tokenization_ctrl.py
View file @
ea89bec1
...
...
@@ -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
=
{
...
...
transformers/tokenization_openai.py
View file @
ea89bec1
...
...
@@ -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
=
{
...
...
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