Apply several ruff SIM rules (#37283)
* Apply ruff SIM118 fix Signed-off-by: cyy <cyyever@outlook.com> * Apply ruff SIM910 fix Signed-off-by: cyy <cyyever@outlook.com> * Apply ruff SIM101 fix Signed-off-by: cyy <cyyever@outlook.com> * Format code Signed-off-by: cyy <cyyever@outlook.com> * More fixes Signed-off-by: cyy <cyyever@outlook.com> --------- Signed-off-by: cyy <cyyever@outlook.com>
This commit is contained in:
@@ -568,7 +568,7 @@ class PipelineUtilsTest(unittest.TestCase):
|
||||
from transformers.pipelines import SUPPORTED_TASKS
|
||||
|
||||
set_seed_fn = lambda: torch.manual_seed(0) # noqa: E731
|
||||
for task in SUPPORTED_TASKS.keys():
|
||||
for task in SUPPORTED_TASKS:
|
||||
if task == "table-question-answering":
|
||||
# test table in separate test due to more dependencies
|
||||
continue
|
||||
@@ -627,7 +627,7 @@ class PipelineUtilsTest(unittest.TestCase):
|
||||
model_ids = []
|
||||
revisions = []
|
||||
tasks = []
|
||||
for translation_pair in task_dict["default"].keys():
|
||||
for translation_pair in task_dict["default"]:
|
||||
model_id, revision = task_dict["default"][translation_pair]["model"][framework]
|
||||
|
||||
model_ids.append(model_id)
|
||||
|
||||
Reference in New Issue
Block a user