From 06787d66d8c9e98740c0570abf2fcb923a9d2b3f Mon Sep 17 00:00:00 2001 From: "yuze.zyz" Date: Tue, 13 Sep 2022 18:48:55 +0800 Subject: [PATCH] [to #42322933] fix forward input in token classification Link: https://code.alibaba-inc.com/Ali-MaaS/MaaS-lib/codereview/10103632 --- modelscope/pipelines/nlp/word_segmentation_pipeline.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modelscope/pipelines/nlp/word_segmentation_pipeline.py b/modelscope/pipelines/nlp/word_segmentation_pipeline.py index 9899243e..7e8b22bc 100644 --- a/modelscope/pipelines/nlp/word_segmentation_pipeline.py +++ b/modelscope/pipelines/nlp/word_segmentation_pipeline.py @@ -62,7 +62,7 @@ class WordSegmentationPipeline(Pipeline): text = inputs.pop(OutputKeys.TEXT) with torch.no_grad(): return { - **self.model(inputs, **forward_params), OutputKeys.TEXT: text + **self.model(**inputs, **forward_params), OutputKeys.TEXT: text } def postprocess(self, inputs: Dict[str, Any],