Skip to content

Commit

Permalink
Changed to if/else instead of returning when checking if the c-TF-IDF…
Browse files Browse the repository at this point in the history
… matrix is None
  • Loading branch information
sete39 committed Aug 7, 2024
1 parent dcdf0fb commit dd19cb2
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions bertopic/_bertopic.py
Original file line number Diff line number Diff line change
Expand Up @@ -3351,13 +3351,13 @@ def save(
"The c-TF-IDF matrix could not be saved as it was not found. "
"This typically occurs when merging BERTopic models with `BERTopic.merge_models`."
)
return
save_utils.save_ctfidf(
model=self,
save_directory=save_directory,
serialization=serialization,
)
save_utils.save_ctfidf_config(model=self, path=save_directory / "ctfidf_config.json")
else:
save_utils.save_ctfidf(
model=self,
save_directory=save_directory,
serialization=serialization,
)
save_utils.save_ctfidf_config(model=self, path=save_directory / "ctfidf_config.json")

@classmethod
def load(cls, path: str, embedding_model=None):
Expand Down

0 comments on commit dd19cb2

Please sign in to comment.