Skip to content

Commit

Permalink
refactor: use json.dump instead of f.write + json.dumps
Browse files Browse the repository at this point in the history
  • Loading branch information
raphael0202 committed Oct 25, 2023
1 parent ed8fd38 commit 60f15e9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/category_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,11 @@ def run(lang: Optional[str] = None):

category_taxonomy = get_taxonomy("category")
with open(WRITE_PATH / "categories.full.json", "w") as f:
f.write(json.dumps(category_taxonomy.to_dict()))
json.dump(category_taxonomy.to_dict(), f)

ingredient_taxonomy = get_taxonomy("ingredient")
with open(WRITE_PATH / "ingredients.full.json", "w") as f:
f.write(json.dumps(category_taxonomy.to_dict()))
json.dump(ingredient_taxonomy.to_dict(), f)

datasets = generate_train_test_val_datasets(
category_taxonomy, ingredient_taxonomy, training_stream, lang
Expand Down

0 comments on commit 60f15e9

Please sign in to comment.