[fix] encoding

This commit is contained in:
Sayo
2025-05-06 20:24:16 +08:00
parent 4c71c1e8b4
commit ac9a34a03f
4 changed files with 5 additions and 8 deletions
+1 -4
View File
@@ -6,16 +6,13 @@ import random
DEFAULT_ROOT_DIR = "examples/input_params"
class DataSampler:
def __init__(self, root_dir=DEFAULT_ROOT_DIR):
self.root_dir = root_dir
# glob
self.input_params_files = list(Path(self.root_dir).glob("*.json"))
def load_json(self, file_path):
with open(file_path, "r") as f:
with open(file_path, "r", encoding="utf-8") as f:
return json.load(f)
def sample(self):