mirror of
https://github.com/modelscope/FunASR
synced 2025-09-15 14:48:36 +08:00
commit
22f0bd8265
@ -197,9 +197,9 @@ class Speech2Text:
|
||||
|
||||
# data: (Nsamples,) -> (1, Nsamples)
|
||||
# lengths: (1,)
|
||||
if len(speech.size()) < 3:
|
||||
speech = speech.unsqueeze(0).to(getattr(torch, self.dtype))
|
||||
speech_lengths = speech.new_full([1], dtype=torch.long, fill_value=speech.size(1))
|
||||
# if len(speech.size()) < 3:
|
||||
# speech = speech.unsqueeze(0).to(getattr(torch, self.dtype))
|
||||
# speech_lengths = speech.new_full([1], dtype=torch.long, fill_value=speech.size(1))
|
||||
lfr_factor = max(1, (speech.size()[-1]//80)-1)
|
||||
|
||||
batch = {"speech": speech, "speech_lengths": speech_lengths}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user