INNER CODE UNIT · Python

load_yaml

CogStack/OpenGPT · opengpt/config.py:72

    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

        self.path = {'self': os.path.join(self.base_path, f'config_for_{self.name}.json')}
        if _config.get('static_paths', None):
            self.path.update(_config['static_paths'])

        if self.to_box:
            self._to_box()

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…