Skip to content

Commit

Permalink
feat: use ensure_ascii=False for KnowledgeGraph files (#1518)
Browse files Browse the repository at this point in the history
To avoid \u escape sequences in KnowledgeGraph json files and have clean
readable text for non-ASCII chars.

related to #1022
  • Loading branch information
dlyz authored Oct 16, 2024
1 parent dbfd61c commit 9408d10
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ragas/testset/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def save(self, path: t.Union[str, Path]):
"relationships": [rel.model_dump() for rel in self.relationships],
}
with open(path, "w") as f:
json.dump(data, f, cls=UUIDEncoder, indent=2)
json.dump(data, f, cls=UUIDEncoder, indent=2, ensure_ascii=False)

@classmethod
def load(cls, path: t.Union[str, Path]) -> "KnowledgeGraph":
Expand Down

0 comments on commit 9408d10

Please sign in to comment.