diff --git a/mingpt/model.py b/mingpt/model.py index 188b3dd..ef52fe1 100644 --- a/mingpt/model.py +++ b/mingpt/model.py @@ -100,8 +100,8 @@ class Block(nn.Module): class GPT(nn.Module): """ GPT Language Model """ - @classmethod - def get_default_config(cls): + @staticmethod + def get_default_config(): C = CN() # either model_type or (n_layer, n_head, n_embd) must be given in the config C.model_type = 'gpt' diff --git a/mingpt/trainer.py b/mingpt/trainer.py index e487576..ee6bc0b 100644 --- a/mingpt/trainer.py +++ b/mingpt/trainer.py @@ -12,8 +12,8 @@ from mingpt.utils import CfgNode as CN class Trainer: - @classmethod - def get_default_config(cls): + @staticmethod + def get_default_config(): C = CN() # device to train on C.device = 'auto' diff --git a/projects/adder/adder.py b/projects/adder/adder.py index 3f3cf5c..eda5e07 100644 --- a/projects/adder/adder.py +++ b/projects/adder/adder.py @@ -65,8 +65,8 @@ class AdditionDataset(Dataset): correctly. """ - @classmethod - def get_default_config(cls): + @staticmethod + def get_default_config(): C = CN() C.ndigit = 2 return C diff --git a/projects/chargpt/chargpt.py b/projects/chargpt/chargpt.py index 78e6c04..bcaca10 100644 --- a/projects/chargpt/chargpt.py +++ b/projects/chargpt/chargpt.py @@ -44,8 +44,8 @@ class CharDataset(Dataset): Emits batches of characters """ - @classmethod - def get_default_config(cls): + @staticmethod + def get_default_config(): C = CN() C.block_size = 128 return C