Apply ruff flake8-comprehensions (#21694)
This commit is contained in:
@@ -250,7 +250,7 @@ def main():
|
||||
# Prepare label mappings.
|
||||
# We'll include these in the model's config to get human readable labels in the Inference API.
|
||||
labels = dataset["train"].features["labels"].names
|
||||
label2id, id2label = dict(), dict()
|
||||
label2id, id2label = {}, {}
|
||||
for i, label in enumerate(labels):
|
||||
label2id[label] = str(i)
|
||||
id2label[str(i)] = label
|
||||
|
||||
Reference in New Issue
Block a user