开发者社区 > ModelScope模型即服务 > 自然语言处理 > 正文

llamaindex整合modelscope本地模型,启动报错

Traceback (most recent call last):
  File "E:\soft\anaconda3\envs\qwen1\lib\site-packages\modelscope\utils\registry.py", line 211, in build_from_cfg
    return obj_cls(**args)
  File "E:\soft\anaconda3\envs\qwen1\lib\site-packages\modelscope\pipelines\nlp\llm_pipeline.py", line 190, in __init__
    self._init_swift(kwargs['model'], kwargs.get('device', 'gpu'))
  File "E:\soft\anaconda3\envs\qwen1\lib\site-packages\modelscope\pipelines\nlp\llm_pipeline.py", line 219, in _init_swift
    from swift.llm.utils import MODEL_MAPPING, InferArguments
ImportError: cannot import name 'MODEL_MAPPING' from 'swift.llm.utils' (E:\soft\anaconda3\envs\qwen1\lib\site-packages\swift\llm\utils.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "e:\work\AI\qwen1\main.py", line 4, in <module>
    llm = ModelScopeLLM(model_name="Qwen/Qwen2.5-1.5B-Instruct", model_revision="master")
  File "E:\soft\anaconda3\envs\qwen1\lib\site-packages\llama_index\llms\modelscope\base.py", line 133, in __init__
    pipeline = pipeline_builder(
  File "E:\soft\anaconda3\envs\qwen1\lib\site-packages\modelscope\pipelines\builder.py", line 180, in pipeline
    return build_pipeline(cfg, task_name=task)
  File "E:\soft\anaconda3\envs\qwen1\lib\site-packages\modelscope\pipelines\builder.py", line 65, in build_pipeline
    return build_from_cfg(
  File "E:\soft\anaconda3\envs\qwen1\lib\site-packages\modelscope\utils\registry.py", line 214, in build_from_cfg
    raise type(e)(f'{obj_cls.__name__}: {e}')
ImportError: LLMPipeline: cannot import name 'MODEL_MAPPING' from 'swift.llm.utils' (E:\soft\anaconda3\envs\qwen1\lib\site-packages\swift\llm\utils.py)

环境安装根据llamaindex官网与modelscope安装的,我现在还需要安装什么环境吗?

展开
收起
1809979304209485 2025-01-06 11:33:10 16 0
0 条回答
写回答
取消 提交回答

包含命名实体识别、文本分类、分词、关系抽取、问答、推理、文本摘要、情感分析、机器翻译等多个领域

热门讨论

热门文章

相关电子书

更多
视觉AI能力的开放现状及ModelScope实战 立即下载
ModelScope助力语音AI模型创新与应用 立即下载
低代码开发师(初级)实战教程 立即下载