Spaces:
Sleeping
Sleeping
File size: 677 Bytes
09179c9 839b121 09179c9 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
import os
import json
import logging
import configparser
ROOT_PATH = os.path.split(os.path.split(os.path.abspath(__file__))[0])[0]
def load_json(fp, encoding='utf-8', json_lines=False):
with open(fp, encoding=encoding) as fin:
if not json_lines:
return json.load(fin)
else:
return [json.loads(line) for line in fin]
def read_config():
config_file = ROOT_PATH + "\conf\config.ini"
config_ini = configparser.ConfigParser()
config_ini.read(config_file)
model_name = "DouBao128Pro"
return config_ini
def read_json(filepath):
with open(filepath, 'r') as f:
result = json.load(f)
return result
|