[Taskflow] Fix the recognition bug of json format with both PIR suffix and id2label #10487
+21
−8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR types
Bug fixes
PR changes
APIs
Description
修复了在调用taskflow读取静态模型时PIR模型文件与id2label词典后缀都为
.json
时,taskflow错误将id2label.json读取为模型文件的错误。Bug触发条件:
在完成multi_class文本分类训练后,根据文档执行模型预测,调用taskflow。
如果直接将模型json更改为id2label也会报错:
修复后可以正常执行:
@DrownFish19