python修改json文件(纯记录)
## 修改json文件
j1='cores/models/company_events_1115/torch/mtl_setting.json'
dict={}
params=json.load(open(j1,'rb')) ## 只读模式
params['model_path']='cores/models/company_events_1115'##修改里面的value
params['pretrain_model_path']='cores/pretrained/RoBERTa_zh_L12_PyTorch' ## 修改里面的value
dict=params ##将参数传回去
with open(j1,'w') as r:
json.dump(dict,r)