Skip to content

Commit

Permalink
check for None first
Browse files Browse the repository at this point in the history
  • Loading branch information
stevetracvc committed Jun 9, 2023
1 parent 2fce29b commit 6f2f48e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bertopic/_bertopic.py
Original file line number Diff line number Diff line change
Expand Up @@ -3180,6 +3180,8 @@ def _reduce_dimensionality(self,
# Regular fit
else:
try:
# cuml umap needs y to be a numpy array
y = np.array(y) if y is not None else None
self.umap_model.fit(embeddings, y=y)
except TypeError:
logger.info("The dimensionality reduction algorithm did not contain the `y` parameter and"
Expand Down

0 comments on commit 6f2f48e

Please sign in to comment.