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

[Question] running self trained NER model causes errors #46

Open
1 task done
breadbread1984 opened this issue Jul 31, 2024 · 1 comment
Open
1 task done

[Question] running self trained NER model causes errors #46

breadbread1984 opened this issue Jul 31, 2024 · 1 comment
Labels
question Further information is requested

Comments

@breadbread1984
Copy link

breadbread1984 commented Jul 31, 2024

What is your question?

error message:

Traceback (most recent call last):
  File "/root/raid/electrolyte_papers_extraction/NER/ner.py", line 31, in <module>
    ner = NER('ckpt/ner/240731013859.938009/output_best', device = 'gpu')
  File "/root/raid/electrolyte_papers_extraction/NER/ner.py", line 12, in __init__
    self.pipeline = pipeline(Tasks.named_entity_recognition, abspath(ckpt), device = device)
  File "/usr/local/lib/python3.10/dist-packages/modelscope/pipelines/builder.py", line 169, in pipeline
    return build_pipeline(cfg, task_name=task)
  File "/usr/local/lib/python3.10/dist-packages/modelscope/pipelines/builder.py", line 65, in build_pipeline
    return build_from_cfg(
  File "/usr/local/lib/python3.10/dist-packages/modelscope/utils/registry.py", line 215, in build_from_cfg
    raise type(e)(f'{obj_cls.__name__}: {e}')
RuntimeError: SequenceLabelingPipeline: SequenceLabelingModel: TransformerEmbedder: Try loading from huggingface and modelscope failed 

huggingface:
The request model: google-bert/bert-base-cased does not exist!

modelscope:
The request model: google-bert/bert-base-cased does not exist!

self trained NER checkpoint:

https://github.com/breadbread1984/electrolyte_papers_extraction/tree/main/NER/ckpt/ner/240731013859.938009

What have you tried?

under ckpt/ner/. edit <path/to/latest/checkpoint>/output_best/configuration.json to change the following lines

from

    "plugins": [
        "adaseq"
    ]

to

    "plugins": [
        "https://files.pythonhosted.org/packages/49/47/ddf684253dbb4c3e0716fcda67094aa3c407237d5eb8930ede0a91b9feb8/adaseq-0.6.6-py3-none-any.whl"
    ]

Code (if necessary)

source code:

from os.path import abspath
from modelscope.pipelines import pipeline
from modelscope.utils.constant import Tasks
pipeline_ = pipeline(Tasks.named_entity_recognition, abspath('ckpt/ner/240731013859.938009/output_best'), device = 'gpu')

What's your environment?

  • AdaSeq Version (e.g., 1.0 or master): 0.6.6
  • ModelScope Version (e.g., 1.0 or master): 1.16.1
  • PyTorch Version (e.g., 1.12.1): 2.2.0a0+81ea7a4
  • OS (e.g., Ubuntu 20.04): Ubuntu 22.04.3 LTS
  • Python version: 3.10.12
  • CUDA/cuDNN version: 8.9.7.29-1+cuda12.2
  • GPU models and configuration: A100
  • Any other relevant information:

Code of Conduct

  • I agree to follow this project's Code of Conduct
@breadbread1984 breadbread1984 added the question Further information is requested label Jul 31, 2024
@1823616178
Copy link

先把模型下载下来,再把路径添加至配置文件中

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

2 participants