Skip to content

Commit

Permalink
make model and model family obligatory
Browse files Browse the repository at this point in the history
  • Loading branch information
Alessandro Sordoni committed Aug 12, 2024
1 parent a4073b7 commit 7115983
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions mttl/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,12 @@ def dataset_config(self):
)

def __post_init__(self):
if self.model is None:
raise ValueError("`model` is not specified and required!")

if self.model_family is None:
raise ValueError("`model_family` is not specified and required!")

if self.attn_implementation == "eager" and self.pack_sequences:
logger.warning(
"Eager attention is not compatible with packed sequences"
Expand All @@ -436,18 +442,6 @@ def __post_init__(self):
+ "into account when computing `gradient_accumulation_steps`."
)

if self.model_family is None:
# infer model family automatically
if "t5" in self.model or "T0" in self.model:
self.model_family = "seq2seq"
else:
self.model_family = "gpt"

logger.warn(
"Model family was not specified, inferring from model name:",
self.model_family,
)


@dataclass
class ExpertConfig(TrainingArgs, ModifierArgs):
Expand Down

0 comments on commit 7115983

Please sign in to comment.