[New Model] Support BertForTokenClassification / Named Entity Recognition (NER) task (#24872)

Signed-off-by: wang.yuqi <noooop@126.com>
Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn>
Co-authored-by: Isotr0py <mozf@mail2.sysu.edu.cn>
This commit is contained in:
wang.yuqi
2025-09-18 23:22:01 +08:00
committed by GitHub
co-authored by Isotr0py
parent 67244c86f0
commit 5f696c33b1
11 changed files with 257 additions and 2 deletions
+4
View File
@@ -943,6 +943,10 @@ class LLM:
considered legacy and may be deprecated in the future. You should
instead pass them via the `inputs` parameter.
"""
if self.supported_tasks == ["encode"] and pooling_task is None:
pooling_task = "encode"
if pooling_task is None:
if "embed" in self.supported_tasks:
pooling_task = "embed"