INNER CODE UNIT · Python

reload_yaml

CogStack/OpenGPT · opengpt/config.py:69

    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

        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'])

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…