Skip to content

Commit

Permalink
return None for PCA
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszkolodziejczyk committed Jan 20, 2025
1 parent cfbc578 commit 35ce379
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mostlyai/qa/_filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,8 @@ def store_pca_model(self, pca_model: PCA):
sio.dump(pca_model, self.pca_model_path)

def load_pca_model(self) -> PCA | None:
if not self.pca_model_path.exists():
return None
unknown_types = sio.get_untrusted_types(file=self.pca_model_path)
if unknown_types:
raise ValueError(f"Unknown types found in file {self.pca_model_path}: {unknown_types}")
Expand Down

0 comments on commit 35ce379

Please sign in to comment.