Fix: ensure encoding=utf-8 for json
This commit is contained in:
@@ -11,7 +11,7 @@ def set_style_config(json_path, output_path):
|
||||
json_dict = json.load(f)
|
||||
json_dict["data"]["num_styles"] = 1
|
||||
json_dict["data"]["style2id"] = {DEFAULT_STYLE: 0}
|
||||
with open(output_path, "w") as f:
|
||||
with open(output_path, "w", encoding="utf-8") as f:
|
||||
json.dump(json_dict, f, indent=2)
|
||||
logger.info(f"Save style config (only {DEFAULT_STYLE}) to {output_path}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user