chatglm6b is not in the text-generation

from modelscope.pipelines import pipeline
from modelscope.utils.constant import Tasks

p = pipeline('text-generation', 'ZhipuAI/ChatGLM-6B')

KeyError: 'chatglm6b-text-generation is not in the pipelines registry group text-generation. Please make sure the correct version of ModelScope library is used.'

展开
收起
1151029891145195 2023-06-05 18:38:35 533 分享 版权
1 条回答
写回答
取消 提交回答
  • from modelscope.utils.constant import Tasks
    from modelscope.pipelines import pipeline
    pipe = pipeline(task=Tasks.chat, model='ZhipuAI/ChatGLM-6B', model_revision='v1.0.14')
    inputs = {'text':'你好', 'history': []}
    result = pipe(inputs)
    inputs = {'text':'介绍下清华大学', 'history': result['history']}
    result = pipe(inputs)
    print(result)
    

    参考示例,这是一个对话task

    2023-06-06 17:43:01
    赞同 展开评论

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

热门讨论

热门文章

还有其他疑问?
咨询AI助理