Add files via upload
This commit is contained in:
parent
0978bb2f1d
commit
1284bb346b
238 changed files with 13931 additions and 3 deletions
12
trustllm/utils/file_process.py
Normal file
12
trustllm/utils/file_process.py
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
import json
|
||||
import os
|
||||
|
||||
|
||||
def load_json(file_path):
|
||||
with open(file_path, 'r', encoding='utf-8') as f:
|
||||
return json.load(f)
|
||||
|
||||
|
||||
def save_json(data, file_path):
|
||||
with open(file_path, 'w', encoding='utf-8') as f:
|
||||
json.dump(data, f, ensure_ascii=False, indent=4)
|
||||
Loading…
Add table
Add a link
Reference in a new issue