Skip to content

Commit ee6e71e

Browse files
committed
Fix quality
1 parent 24b930a commit ee6e71e

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ target-version = ['py37']
44

55
[tool.ruff]
66
# Never enforce `E501` (line length violations).
7-
ignore = ["E501", "E741", "W605"]
7+
ignore = ["C901", "E501", "E741", "W605"]
88
select = ["C", "E", "F", "I", "W"]
99
line-length = 119
1010

src/transformers/models/efficientnet/convert_efficientnet_to_pytorch.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def convert_image_processor(model_name):
160160
# here we list all keys to be renamed (original name on the left, our name on the right)
161161
def rename_keys(original_param_names):
162162
block_names = [v.split("_")[0].split("block")[1] for v in original_param_names if v.startswith("block")]
163-
block_names = sorted(list(set(block_names)))
163+
block_names = sorted(set(block_names))
164164
num_blocks = len(block_names)
165165
block_name_mapping = {b: str(i) for b, i in zip(block_names, range(num_blocks))}
166166

@@ -267,7 +267,7 @@ def convert_efficientnet_checkpoint(model_name, pytorch_dump_folder_path, save_m
267267
tf_params = {param.name: param.numpy() for param in tf_params}
268268
for param in tf_non_train_params:
269269
tf_params[param.name] = param.numpy()
270-
tf_param_names = [k for k in tf_params.keys()]
270+
tf_param_names = list(tf_params.keys())
271271

272272
# Load HuggingFace model
273273
config = get_efficientnet_config(model_name)

src/transformers/models/gptsan_japanese/modeling_gptsan_japanese.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1029,7 +1029,7 @@ def forward(
10291029
) # n_layer x batch x n_heads x N x N
10301030

10311031
# outputs
1032-
present_key_value_states = tuple() if self.config.use_cache or use_cache else None
1032+
present_key_value_states = () if self.config.use_cache or use_cache else None
10331033
all_hidden_states = () if self.config.output_hidden_states or output_hidden_states else None
10341034
all_attentions = () if self.config.output_attentions or output_attentions else None
10351035
all_router_probs = () if self.config.output_router_logits or output_router_logits else None

0 commit comments

Comments
 (0)