Update modeling_bark.py (#30221)

Change .view() to .reshape() to prevent errors on non-contiguous tensors
This commit is contained in:
Sergei Belousov 2024-04-12 19:03:38 +03:00 committed by GitHub
parent bf9a7ab932
commit 4f7b434acb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -1068,7 +1068,7 @@ class BarkCoarseModel(BarkCausalModel):
x_coarse_history[n, :] += codebook_size * n
# flatten x_coarse_history
x_coarse_history = torch.transpose(x_coarse_history, 0, 1).view(-1)
x_coarse_history = torch.transpose(x_coarse_history, 0, 1).reshape(-1)
x_coarse_history = x_coarse_history + semantic_generation_config.semantic_vocab_size