IDSIA/sacred

how to make the config.json file saved correctly ?

zhan0903 opened this issue · 4 comments

the config variants are saved in config.json as Unicode, for instance, "\u6211", how to make the config.json file saved correctly?

Can you give a bit more context and an example? What kind of data do you write in your config that is saved "incorrectly"?

my config variants have some Chinese strings, for instance, "今天天气如何", the characters in count.txt are correct, but in the config.json, these Chinese strings are transformed to Unicode, such as "\u6211". I use Python and vs code.

Can you try if adding ensure_ascii=False to

json.dump(flatten(obj), f, sort_keys=True, indent=2)
solves the issue?

It works, thank you.