Skip to content

Commit

Permalink
Fixed CoW RuntimeError in DecodingTask.run() (#240)
Browse files Browse the repository at this point in the history
  • Loading branch information
CorentinJ authored Oct 4, 2022
1 parent 02b7430 commit 9e653bd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion whisper/decoding.py
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ def run(self, mel: Tensor) -> List[DecodingResult]:
n_audio: int = mel.shape[0]

audio_features: Tensor = self._get_audio_features(mel) # encoder forward pass
tokens: Tensor = torch.tensor([self.initial_tokens]).expand(n_audio, -1)
tokens: Tensor = torch.tensor([self.initial_tokens]).repeat(n_audio, 1)

# detect language if requested, overwriting the language token
languages, language_probs = self._detect_language(audio_features, tokens)
Expand Down

0 comments on commit 9e653bd

Please sign in to comment.