diff --git a/src/crewai/cli/train_crew.py b/src/crewai/cli/train_crew.py index 369cd558d..a22647828 100644 --- a/src/crewai/cli/train_crew.py +++ b/src/crewai/cli/train_crew.py @@ -16,6 +16,9 @@ def train_crew(n_iterations: int, filename: str) -> None: if n_iterations <= 0: raise ValueError("The number of iterations must be a positive integer.") + if filename.endswith(".pkl"): + raise ValueError("The filename must not end with .pkl") + result = subprocess.run(command, capture_output=False, text=True, check=True) if result.stderr: