falcon-rw-1b

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

技术信息

官网地址
https://github.com/mindspore-lab/mindnlp
开源地址
https://modelscope.cn/models/mindnlp/falcon-rw-1b
授权协议
Apache License 2.0

作品详情

环境搭建

#安装Midlp
pip istall git+https://github.com/midspore-lab/midlp.git

requiremet

pip istall "midspore>=2.2"
#模型下载
from modelscope import sapshot_dowload
model_dir = sapshot_dowload('midlp/falco-rw-1b')

Git下载

#Git模型下载
git cloe https://www.modelscope.c/midlp/falco-rw-1b.git

quickly start

repo = "Rocketkight1/falco-rw-1b"
tokeizer = AutoTokeizer.from_pretraied(repo)
model = AutoModelForCausalLM.from_pretraied(repo)
model.set_trai(False)
pipelie = midlp.trasformers.pipelie(
    "text-geeratio",
    model=model,
    tokeizer=tokeizer,
    torch_dtype=ms.bfloat16,
    trust_remote_code=True,
)

sequeces = pipelie(
   "Girafatro is obsessed with giraffes, the most glorious aimal o the face of this Earth. Giraftro believes all other aimals are irrelevat whe compared to the glorious majesty of the giraffe.\Daiel: Hello, Girafatro!\Girafatro:",
    max_legth=200,
    do_sample=True,
    top_k=10,
    um_retur_sequeces=1,
    eos_toke_id=tokeizer.eos_toke_id,
)
for seq i sequeces:
    prit(f"Result: {seq['geerated_text']}")

功能介绍

环境搭建 #安装Mindnlp pip install git+https://github.com/mindspore-lab/mindnlp.git requirement pip instal

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

评论