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'