NLP模型:rex-uninlu
modelscope 版本:1.9.5
加载模型时报错:
semantic_cls = pipeline('rex-uninlu', model='damo/nlp_deberta_rex-uninlu_chinese-base', model_revision='v1.2.1')
2023-12-04 11:52:33,717 - modelscope - INFO - Use user-specified model revision: v1.2.1
2023-12-04 11:52:34,347 - modelscope - WARNING - ('PIPELINES', 'rex-uninlu', 'nlp_deberta_rex-uninlu_chinese-base-pipe') not found in ast index file
2023-12-04 11:52:34,347 - modelscope - INFO - initiate model from /root/.cache/modelscope/hub/damo/nlp_deberta_rex-uninlu_chinese-base
2023-12-04 11:52:34,348 - modelscope - INFO - initiate model from location /root/.cache/modelscope/hub/damo/nlp_deberta_rex-uninlu_chinese-base.
2023-12-04 11:52:34,349 - modelscope - WARNING - No preprocessor field found in cfg.
2023-12-04 11:52:34,350 - modelscope - WARNING - No val key and type key found in preprocessor domain of configuration.json file.
2023-12-04 11:52:34,350 - modelscope - WARNING - Cannot find available config to build preprocessor at mode inference, current config: {'model_dir': '/root/.cache/modelscope/hub/damo/nlp_deberta_rex-uninlu_chinese-base'}. trying to build by task and model information.
2023-12-04 11:52:34,350 - modelscope - WARNING - Find task: rex-uninlu, model type: None. Insufficient information to build preprocessor, skip building preprocessor
2023-12-04 11:52:34,350 - modelscope - INFO - cuda is not available, using cpu instead.
Traceback (most recent call last):
File "/root/miniconda3/envs/nlp/lib/python3.8/site-packages/modelscope/utils/registry.py", line 212, in build_from_cfg
return obj_cls(args)
File "/root/.cache/modelscope/modelscope_modules/nlp_deberta_rex-uninlu_chinese-base/ms_wrapper.py", line 29, in init
self.model, self.trainer = self.init_model(kwargs)
File "/root/.cache/modelscope/modelscope_modules/nlp_deberta_rex-uninlu_chinese-base/ms_wrapper.py", line 32, in init_model
data_args, training_args, model_args = get_args()
File "/root/.cache/modelscope/modelscope_modules/nlp_deberta_rex-uninlu_chinese-base/rex/arguments.py", line 107, in get_args
data_args, training_args, model_args, remaining_args = parser.parse_args_into_dataclasses(return_remaining_strings=True)
File "/root/miniconda3/envs/nlp/lib/python3.8/site-packages/transformers/hf_argparser.py", line 308, in parse_args_into_dataclasses
args_files.append(Path(sys.argv[0]).with_suffix(".args"))
File "/root/miniconda3/envs/nlp/lib/python3.8/pathlib.py", line 872, in with_suffix
raise ValueError("%r has an empty name" % (self,))
ValueError: PosixPath('.') has an empty name
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "", line 1, in
File "/root/miniconda3/envs/nlp/lib/python3.8/site-packages/modelscope/pipelines/builder.py", line 162, in pipeline
return build_pipeline(cfg, task_name=task)
File "/root/miniconda3/envs/nlp/lib/python3.8/site-packages/modelscope/pipelines/builder.py", line 65, in build_pipeline
return build_from_cfg(
File "/root/miniconda3/envs/nlp/lib/python3.8/site-packages/modelscope/utils/registry.py", line 215, in build_from_cfg
raise type(e)(f'{obj_cls.name}: {e}')
ValueError: RexUniNLUPipeline: PosixPath('.') has an empty name
没看到你的代码,但是按照报错信息看你是不是没有传信息或者文件再或者你传的文件不存在或者路径错误,造成模型在初始化的时候参数不足报错了