Skip to content

Commit 6f2f48e

Browse files
committed
check for None first
1 parent 2fce29b commit 6f2f48e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

bertopic/_bertopic.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3180,6 +3180,8 @@ def _reduce_dimensionality(self,
31803180
# Regular fit
31813181
else:
31823182
try:
3183+
# cuml umap needs y to be a numpy array
3184+
y = np.array(y) if y is not None else None
31833185
self.umap_model.fit(embeddings, y=y)
31843186
except TypeError:
31853187
logger.info("The dimensionality reduction algorithm did not contain the `y` parameter and"

0 commit comments

Comments
 (0)