inference.py 499 字节
Newer Older
CSDN-Ada助手's avatar
CSDN-Ada助手 已提交
1 2 3 4 5 6 7 8 9 10

import os
import json
import logging


logger = logging.getLogger(__name__)


class Inference(object):
CSDN-Ada助手's avatar
fix bug  
CSDN-Ada助手 已提交
11 12
    def __init__(self):
        self.params_base_url = "../llm_set/params/default.json"
CSDN-Ada助手's avatar
CSDN-Ada助手 已提交
13 14 15 16 17 18 19
        self.paras_base_dict = self.get_paras_base()

    def get_paras_base(self):
        if not os.path.exists(self.params_base_url):
            logger.error(f"params_base_url:{self.params_base_url} is not exists.")
        content = open(self.params_base_url).read()
        return json.loads(content)