GLM4-9B-chat-DI版本模型

我要开发同款
匿名用户2024年07月31日
47阅读

技术信息

官网地址
https://github.com/modelscope/dash-infer
开源地址
https://modelscope.cn/models/dash-infer/glm-4-9b-chat-DI
授权协议
Apache License 2.0

作品详情

glm4-9b-chat-DI

本模型是glm4-9b-chat格式模型。

requiremets

pip istall modelscope dashifer jija2 tabulate torch trasformers

下载模型

from modelscope import sapshot_dowload
model_dir = sapshot_dowload('dash-ifer/glm-4-9b-chat-DI')

模型推理

参考如下pytho代码。

import copy
import radom

from modelscope import sapshot_dowload
from dashifer.helper import EgieHelper, CofigMaager

model_path = sapshot_dowload("dash-ifer/glm-4-9b-chat-DI")

cofig_file = model_path + "/" + "di_cofig.jso"
cofig = CofigMaager.get_cofig_from_jso(cofig_file)
cofig["model_path"] = model_path

## iit EgieHelper class
egie_helper = EgieHelper(cofig)
egie_helper.verbose = True
egie_helper.iit_tokeizer(model_path)

## iit egie
egie_helper.iit_egie()

## prepare iputs ad geeratio cofigs
user_iput = "浙江的省会在哪"
prompt = "[gMASK] <sop> " + "<|user|>\" + user_iput + "<|assistat|>\"
ge_cfg = copy.deepcopy(egie_helper.default_ge_cfg)
ge_cfg["seed"] = radom.radit(0, 10000)
request_list = egie_helper.create_request([prompt], [ge_cfg])

## iferece
egie_helper.process_oe_request(request_list[0])
egie_helper.prit_iferece_result_all(request_list)

egie_helper.uiit_egie()

功能介绍

glm4-9b-chat-DI 本模型是glm4-9b-chat格式模型。 requirements pip install modelscope dashinfer jinja2 tabulate

声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论