in evals/elsuite/make_me_say/core.py [0:0]
def __post_init__(self):
if self.manipulator == self.manipulatee:
raise ValueError("Player can't play against themselves.")
if self.current_player not in (self.manipulator, self.manipulatee):
raise ValueError("Current player must be either the manipulator or manipulatee.")
if len(self.word_list) != 1:
raise ValueError("Word list must contain exactly one word.")
for word in self.word_list:
if len(word) == 0:
raise ValueError(
f"Invalid codeword: `{word}`. Every words must have at least one character."
)
if not word.isalpha():
raise ValueError(f"Invalid codeword: `{word}`. Every words must be alphabetic.")
if self.max_turns <= 0:
raise ValueError("Max turns must be positive.")
if self.turn < 0:
raise ValueError("Turn must be non-negative.")
if (
self.internal_monologue_start_token is not None
and self.internal_monologue_end_token is None
):
raise ValueError("Both internal monologue start and end tokens must be specified.")
if (
self.internal_monologue_start_token is None
and self.internal_monologue_end_token is not None
):
raise ValueError("Both internal monologue start and end tokens must be specified.")
if self.internal_monologue_start_token == "":
raise ValueError("Internal monologue start token must not be empty.")
if self.internal_monologue_end_token == "":
raise ValueError("Internal monologue end token must not be empty.")
if (
self.internal_monologue_start_token is not None
and self.internal_monologue_end_token is not None
and self.internal_monologue_start_token == self.internal_monologue_end_token
):
raise ValueError("Internal monologue start and end tokens must be different.")