Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions funasr/models/campplus/cluster_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,10 @@ def forward(self, X, **params):
X: TODO.
**params: Additional keyword arguments.
"""
# Normalize the input once so UMAP and the later centroid operations
# receive a NumPy array. Passing a torch.Tensor here makes UMAP 0.6.0
# raise TypeError: Cannot interpret 'torch.float32' as a data type.
X = X.detach().cpu().numpy() if isinstance(X, torch.Tensor) else np.asarray(X)
k = params["oracle_num"] if "oracle_num" in params else None
assert len(X.shape) == 2, "modelscope error: the shape of input should be [N, C]"
if X.shape[0] < 20:
Expand Down