MCPcopy Create free account
hub / github.com/LUMIA-Group/MemoryDecoder / ModelArguments

Class ModelArguments

train_base.py:74–134  ·  view source on GitHub ↗

Arguments pertaining to which model/config/tokenizer we are going to fine-tune, or train from scratch.

Source from the content-addressed store, hash-verified

72
73@dataclass
74class ModelArguments:
75 """
76 Arguments pertaining to which model/config/tokenizer we are going to fine-tune, or train from scratch.
77 """
78
79 model_name_or_path: Optional[str] = field(
80 default=None,
81 metadata={
82 "help": "The model checkpoint for weights initialization."
83 "Don't set if you want to train a model from scratch."
84 },
85 )
86 model_type: Optional[str] = field(
87 default=None,
88 metadata={"help": "If training from scratch, pass a model type from the list: " + ", ".join(MODEL_TYPES)},
89 )
90 config_overrides: Optional[str] = field(
91 default=None,
92 metadata={
93 "help": "Override some existing default config settings when a model is trained from scratch. Example: "
94 "n_embd=10,resid_pdrop=0.2,scale_attn_weights=false,summary_type=cls_index"
95 },
96 )
97 config_name: Optional[str] = field(
98 default=None, metadata={"help": "Pretrained config name or path if not the same as model_name"}
99 )
100 tokenizer_name: Optional[str] = field(
101 default=None, metadata={"help": "Pretrained tokenizer name or path if not the same as model_name"}
102 )
103 cache_dir: Optional[str] = field(
104 default=None,
105 metadata={"help": "Where do you want to store the pretrained models downloaded from huggingface.co"},
106 )
107 use_fast_tokenizer: bool = field(
108 default=True,
109 metadata={"help": "Whether to use one of the fast tokenizer (backed by the tokenizers library) or not."},
110 )
111 model_revision: str = field(
112 default="main",
113 metadata={"help": "The specific model version to use (can be a branch name, tag name or commit id)."},
114 )
115 use_auth_token: bool = field(
116 default=False,
117 metadata={
118 "help": "Will use the token generated when running `transformers-cli login` (necessary to use this script "
119 "with private models)."
120 },
121 )
122 from_scratch: bool = field(
123 default=False,
124 metadata={
125 "help": "Train the model from scratch, starting with a new config, model and tokenizer."
126 },
127 )
128 group_name: str = field(default="default")
129
130 def __post_init__(self):
131 if self.config_overrides is not None and (self.config_name is not None or self.model_name_or_path is not None):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected