Skip to content

KeyError: 'mask' #49

Description

@HuilongYu

What is your question?

在训练完NER模型后进行推理,报错KeyError: 'mask'

What have you tried?

No response

Code (if necessary)

from modelscope.pipelines import pipeline
from modelscope.utils.constant import Tasks
import os

os.environ['HTTP_PROXY'] = 'http://127.0.0.1:7897'
os.environ['HTTPS_PROXY'] = 'http://127.0.0.1:7897'

p = pipeline(
Tasks.named_entity_recognition,
'D:/PyCharm Community Edition 2024.1.1/workspace/SMNER/adaseq/experiments/RiVEG-twitter-10000/241128164248.201824/output_best' # 绝对路径
)
result = p('1984年出生,中国国籍,汉族,硕士学历')

print(result)

What's your environment?

  • AdaSeq Version (e.g., 1.0 or master):
  • ModelScope Version (e.g., 1.0 or master):
  • PyTorch Version (e.g., 1.12.1):
  • OS (e.g., Ubuntu 20.04):
  • Python version:
  • CUDA/cuDNN version:
  • GPU models and configuration:
  • Any other relevant information:

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions