You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm struggling porting the following PyTorch code get the same tensor using GGML:
# 'encoder_output' now contains extracted audio features from the whisper model
# Shape is (batch_size, T, C) for the encoder output
features = encoder_output.squeeze(0) # Remove batch dimension for (T, C) shape
# Ensure features are on the same device
features = features.to(model.device)
features_cpu = features.cpu() # Move to CPU
features = features_cpu.numpy() # Convert to NumPy array
# Convert to PyTorch tensor and set device
features = torch.tensor(features, dtype=torch.float32).to(model.device)
#print("shape of features:", features.shape)
# Reshape features for unfolding operation
features = features.view(-1, C)
features = features.permute(1, 0).contiguous() # Shape becomes (C, T)
features = features.view(1, C, -1, 1) # Shape becomes (1, C, T, 1)
#print("shape of features:", features.shape)
# Unfold the features using a sliding window
unfolded_features = F.unfold(features, kernel_size=(window_size, 1), padding=(padding, 0), stride=(2, 1))
# Reshape unfolded features to desired shape
unfolded_features = unfolded_features.view(C, window_size, -1).permute(2, 1, 0).contiguous()
Getting pretty frustrated at this point since everything I've tried so far does not lead to a desired output tensor of (PyTorch) shape (750, 16, 384).
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi Community.
I'm struggling porting the following PyTorch code get the same tensor using GGML:
Getting pretty frustrated at this point since everything I've tried so far does not lead to a desired output tensor of (PyTorch) shape (750, 16, 384).
Any help is highly appreciated!
Beta Was this translation helpful? Give feedback.
All reactions