mirror of
https://github.com/modelscope/FunASR
synced 2025-09-15 14:48:36 +08:00
fix bug
This commit is contained in:
parent
6e0d138826
commit
1163110135
@ -51,7 +51,7 @@ class OpenAIDataset(torch.utils.data.Dataset):
|
|||||||
self.batch_size = kwargs.get("batch_size")
|
self.batch_size = kwargs.get("batch_size")
|
||||||
self.batch_type = kwargs.get("batch_type")
|
self.batch_type = kwargs.get("batch_type")
|
||||||
self.prompt_ids_len = 0
|
self.prompt_ids_len = 0
|
||||||
self.retry = kwargs.get("retry", 10)
|
self.retry = kwargs.get("retry", 100)
|
||||||
|
|
||||||
self.permute = False
|
self.permute = False
|
||||||
from funasr.frontends.whisper_frontend import WhisperFrontend
|
from funasr.frontends.whisper_frontend import WhisperFrontend
|
||||||
@ -212,13 +212,9 @@ class OpenAIDataset(torch.utils.data.Dataset):
|
|||||||
if self.batch_type != "example":
|
if self.batch_type != "example":
|
||||||
b, t = outputs["input_ids"].shape
|
b, t = outputs["input_ids"].shape
|
||||||
if b > 1 and b * t > self.batch_size * self.batch_size_scale_ratio_max:
|
if b > 1 and b * t > self.batch_size * self.batch_size_scale_ratio_max:
|
||||||
# beg = torch.randint(0, 2, ()).item()
|
|
||||||
# if b < 2:
|
|
||||||
# beg = 0
|
|
||||||
logging.info(
|
logging.info(
|
||||||
f"Warning, b*t: {b}*{t}={b * t} > batch_size*relax: {self.batch_size_scale_ratio_max}*{self.batch_size}={self.batch_size_scale_ratio_max*self.batch_size}, drop half data {idx}th, beg:{beg}"
|
f"Warning, b*t: {b}*{t}={b * t} > batch_size*relax: {self.batch_size_scale_ratio_max}*{self.batch_size}={self.batch_size_scale_ratio_max*self.batch_size}, drop last data"
|
||||||
)
|
)
|
||||||
# samples = samples[beg : beg + b : 2]
|
|
||||||
samples = samples[:-1]
|
samples = samples[:-1]
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user