From 9232ac3e3faa10ed79029a8af9e3ea9e21be611a Mon Sep 17 00:00:00 2001 From: Eduardo Chiarotti Date: Thu, 8 Aug 2024 19:46:20 -0300 Subject: [PATCH] feat: add pkl file validation --- src/crewai/cli/train_crew.py | 3 +++ 1 file changed, 3 insertions(+) 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: