Skip to content

Commit e60c2bb

Browse files
committed
Style.
1 parent 4311e8a commit e60c2bb

File tree

10 files changed

+17
-22
lines changed

10 files changed

+17
-22
lines changed

src/transformers/configuration_utils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -722,4 +722,3 @@ def update_from_string(self, update_str: str):
722722
)
723723

724724
setattr(self, k, v)
725-

src/transformers/models/albert/configuration_albert.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,4 +168,3 @@ def inputs(self) -> Mapping[str, Mapping[int, str]]:
168168
@property
169169
def outputs(self) -> Mapping[str, Mapping[int, str]]:
170170
return {"last_hidden_state": {0: "batch", 1: "sequence"}, "pooler_output": {0: "batch"}}
171-

src/transformers/models/bart/configuration_bart.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,4 +210,4 @@ def outputs(self) -> Mapping[str, Mapping[int, str]]:
210210
return {
211211
"last_hidden_state": {0: "batch", 1: "sequence"},
212212
"encoder_last_hidden_state": {0: "batch", 1: "sequence"},
213-
}
213+
}

src/transformers/models/bert/configuration_bert.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,4 +170,3 @@ def inputs(self) -> Mapping[str, Mapping[int, str]]:
170170
@property
171171
def outputs(self) -> Mapping[str, Mapping[int, str]]:
172172
return {"last_hidden_state": {0: "batch", 1: "sequence"}, "pooler_output": {0: "batch"}}
173-

src/transformers/models/distilbert/configuration_distilbert.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,4 +150,3 @@ def inputs(self) -> Mapping[str, Mapping[int, str]]:
150150
@property
151151
def outputs(self) -> Mapping[str, Mapping[int, str]]:
152152
return {"last_hidden_state": {0: "batch", 1: "sequence"}}
153-

src/transformers/models/gpt2/configuration_gpt2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,4 +218,4 @@ def outputs(self) -> Mapping[str, Mapping[int, str]]:
218218
return {
219219
"last_hidden_state": {0: "batch", 1: "sequence"},
220220
"encoder_last_hidden_state": {0: "batch", 1: "sequence"},
221-
}
221+
}

src/transformers/models/longformer/__init__.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"configuration_longformer": [
2626
"LONGFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP",
2727
"LongformerConfig",
28-
"LongformerOnnxConfig"
28+
"LongformerOnnxConfig",
2929
],
3030
"tokenization_longformer": ["LongformerTokenizer"],
3131
}
@@ -61,11 +61,10 @@
6161

6262

6363
if TYPE_CHECKING:
64-
from .configuration_longformer import LONGFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, LongformerConfig
6564
from .configuration_longformer import (
6665
LONGFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP,
6766
LongformerConfig,
68-
LongformerOnnxConfig
67+
LongformerOnnxConfig,
6968
)
7069
from .tokenization_longformer import LongformerTokenizer
7170

src/transformers/models/longformer/configuration_longformer.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ def __init__(self, attention_window: Union[List[int], int] = 512, sep_token_id:
7373

7474

7575
class LongformerOnnxConfig(OnnxConfig):
76-
7776
@property
7877
def inputs(self) -> Mapping[str, Mapping[int, str]]:
7978
return {
@@ -83,9 +82,4 @@ def inputs(self) -> Mapping[str, Mapping[int, str]]:
8382

8483
@property
8584
def outputs(self) -> Mapping[str, Mapping[int, str]]:
86-
return {
87-
"last_hidden_state": {0: "batch", 1: "sequence"},
88-
"pooler_output": {0: "batch"}
89-
}
90-
91-
85+
return {"last_hidden_state": {0: "batch", 1: "sequence"}, "pooler_output": {0: "batch"}}

src/transformers/models/roberta/configuration_roberta.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,3 @@ def inputs(self) -> Mapping[str, Mapping[int, str]]:
7777
@property
7878
def outputs(self) -> Mapping[str, Mapping[int, str]]:
7979
return {"last_hidden_state": {0: "batch", 1: "sequence"}, "pooler_output": {0: "batch"}}
80-

tests/test_onnx_v2.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,17 @@
33
from unittest import TestCase
44
from unittest.mock import patch
55

6-
from transformers import AutoTokenizer, is_torch_available, AlbertConfig, DistilBertConfig, LongformerConfig, \
7-
RobertaConfig, XLMRobertaConfig
6+
from transformers import (
7+
AlbertConfig,
8+
AutoTokenizer,
9+
DistilBertConfig,
10+
LongformerConfig,
11+
RobertaConfig,
12+
XLMRobertaConfig,
13+
is_torch_available,
14+
)
815
from transformers.models.albert import AlbertOnnxConfig
9-
10-
from transformers.models.bert.configuration_bert import BertOnnxConfig, BertConfig
16+
from transformers.models.bert.configuration_bert import BertConfig, BertOnnxConfig
1117
from transformers.models.distilbert import DistilBertOnnxConfig
1218
from transformers.models.longformer import LongformerOnnxConfig
1319
from transformers.models.roberta import RobertaOnnxConfig
@@ -21,7 +27,7 @@
2127
compute_serialized_parameters_size,
2228
flatten_output_collection_property,
2329
)
24-
from transformers.testing_utils import require_onnx, slow, require_torch
30+
from transformers.testing_utils import require_onnx, require_torch, slow
2531

2632

2733
@require_onnx
@@ -81,6 +87,7 @@ def test_use_external_data_format(self):
8187

8288
if is_torch_available():
8389
from transformers import AlbertModel, BertModel, DistilBertModel, LongformerModel, RobertaModel, XLMRobertaModel
90+
8491
PYTORCH_EXPORT_DEFAULT_MODELS = {
8592
("ALBERT", "albert-base-v2", AlbertModel, AlbertConfig, AlbertOnnxConfig),
8693
("BERT", "bert-base-cased", BertModel, BertConfig, BertOnnxConfig),

0 commit comments

Comments
 (0)