From bac3ef2e250cbb06bc5815af188f165f68ed2066 Mon Sep 17 00:00:00 2001
From: liugz18 <57401541+liugz18@users.noreply.github.com>
Date: 星期三, 12 六月 2024 15:28:41 +0800
Subject: [PATCH] Update auto_model.py

---
 funasr/datasets/openai_datasets/datasets.py |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/funasr/datasets/openai_datasets/datasets.py b/funasr/datasets/openai_datasets/datasets.py
index 9b36078..8d243ac 100644
--- a/funasr/datasets/openai_datasets/datasets.py
+++ b/funasr/datasets/openai_datasets/datasets.py
@@ -63,6 +63,7 @@
         # self.kwargs = kwargs
         self.max_token_length = kwargs.get("max_token_length", 1024)
         self.batch_size_scale_ratio_max = kwargs.get("batch_size_scale_ratio_max", 1.5)
+        self.batch_size_token_max = kwargs.get("batch_size_token_max", 2500)
 
     def get_source_len(self, index):
         item = self.index_ds[index]
@@ -211,9 +212,9 @@
 
             if self.batch_type != "example":
                 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_token_max:
                     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 last data"
+                        f"Warning, {idx}th, b*t: {b}*{t}={b * t} > batch_size_sample_max: {self.batch_size_token_max}, drop last data"
                     )
                     samples = samples[:-1]
                     continue

--
Gitblit v1.9.1