Skip to content

Commit

Permalink
Update modeling_bark.py (#30221)
Browse files Browse the repository at this point in the history
Change .view() to .reshape() to prevent errors on non-contiguous tensors
  • Loading branch information
bes-dev authored Apr 12, 2024
1 parent bf9a7ab commit 4f7b434
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/transformers/models/bark/modeling_bark.py
Original file line number Diff line number Diff line change
Expand Up @@ -1068,7 +1068,7 @@ def preprocess_histories(
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

Expand Down

0 comments on commit 4f7b434

Please sign in to comment.