Skip to content

Commit

Permalink
fix asr ut (#501)
Browse files Browse the repository at this point in the history
  • Loading branch information
Spycsh authored Aug 16, 2024
1 parent fecf4ac commit 9580298
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion comps/asr/whisper/whisper_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def audio2text(self, audio_path):
return_tensors="pt",
sampling_rate=16000,
)
elif self.device == "hpu":
elif self.device == "hpu" and processed_inputs.input_features.shape[-1] > 3000:
processed_inputs["input_features"] = torch.nn.functional.pad(
processed_inputs.input_features,
(0, self.hpu_max_len - processed_inputs.input_features.size(-1)),
Expand Down

0 comments on commit 9580298

Please sign in to comment.