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

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 350 0
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
    赞同 展开评论 打赏

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

相关电子书

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