feat: processors 支持批量 tokenize,优化性能并缓存 chat template

This commit is contained in:
2026-08-05 12:21:25 +08:00
parent aa2ea4f3a6
commit 65dadac10f
10 changed files with 290 additions and 25 deletions
+6
View File
@@ -76,6 +76,12 @@ class BaseProcessor(ABC):
"""
pass
def process_batch(
self, input_dicts: List[Dict[str, Any]]
) -> List[Dict[str, Tensor]]:
"""Process a batch, falling back to the single-record implementation."""
return [self.process(input_dict) for input_dict in input_dicts]
@property
@abstractmethod
def output_keys(self) -> List[str]: