INNER CODE UNIT · Python
__init__
CogStack/OpenGPT · opengpt/config.py:7
def __init__(self, to_box=False):
pass
def _to_box(self):
# Convert all dicts to boxes
for key, val in self.__dict__.items():
if isinstance(val, dict):
self.__setattr__(key, Box(val))
def _from_box(self):
# Convert all dicts to boxes
for key, val in self.__dict__.items():
if isinstance(val, Box):
self.__setattr__(key, val.to_dict())
def save(self, save_path=None):
r''' Save the config into a .json file
Args: