inference.py 495 字节
Newer Older
CSDN-Ada助手's avatar
CSDN-Ada助手 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

import os
import json
import logging


logger = logging.getLogger(__name__)


class Inference(object):
    def __int__(self):
        self.params_base_url = "llm_set/params/default.json"
        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)