Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: 'mask' #49

Open
1 task done
HuilongYu opened this issue Nov 30, 2024 · 1 comment
Open
1 task done

KeyError: 'mask' #49

HuilongYu opened this issue Nov 30, 2024 · 1 comment
Labels
question Further information is requested

Comments

@HuilongYu
Copy link

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
@HuilongYu HuilongYu added the question Further information is requested label Nov 30, 2024
@HuilongYu
Copy link
Author

File "D:\PyCharm Community Edition 2024.1.1\workspace\SMNER\adaseq\adaseq\data\preprocessors\nlp_preprocessor.py", line 108, in call
output_dict['origin_mask'] = data['mask']
KeyError: 'mask'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant