INNER CODE UNIT · Python

__init__

CogStack/OpenGPT · opengpt/config.py:65

    def __init__(self, yaml_path):
        self.yaml_path = yaml_path
        self.load_yaml(yaml_path)

    def reload_yaml(self):
        self.load_yaml(self.yaml_path)

    def load_yaml(self, yaml_path):
        _config = yaml.safe_load(open(yaml_path, 'r'))
        self.to_box = True
        self.base_path = './'
        self.datasets = {}
        self.name = 'opengpt'

        for k,v in _config.items():
            self.__setattr__(k, v)
        # For fun, we will also keept the _config
        self._config = _config

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…