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

执行语句时出错,帮忙看下原因,谢谢~

已解决

from modelscope.models import Model from modelscope.pipelines import pipeline from modelscope.preprocessors import MGLMSummarizationPreprocessor from modelscope.utils.constant import Tasks

model = 'ZhipuAI/Multilingual-GLM-Summarization-zh' preprocessor = MGLMSummarizationPreprocessor() pipe = pipeline( task=Tasks.text_summarization, model=model, preprocessor=preprocessor, model_revision='v1.0.1', )

/opt/conda/lib/python3.7/site-packages/modelscope/models/nlp/mglm/mpu/layers.py in 22 import torch.nn.init as init ---> 23 from apex.normalization.fused_layer_norm import FusedLayerNorm as LayerNorm 24 from torch.nn.parameter import Parameter

ModuleNotFoundError: No module named 'apex'

RuntimeError: Failed to import modelscope.models.nlp.mglm.mglm_for_text_summarization because of the following error (look up to see its traceback): No module named 'apex'

展开
收起
wallowlip 2023-02-24 10:16:48 757 0
1 条回答
写回答
取消 提交回答
  • 推荐回答

    环境问题,有包依赖,确认下apex是否正确安装

    2023-02-24 10:36:45
    赞同 展开评论 打赏

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

热门讨论

热门文章

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载