yayi-13b-llama2

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

技术信息

开源地址
https://modelscope.cn/models/AI-ModelScope/yayi-13b-llama2

作品详情

YaYi

Itroductio

YaYi was fie-tued o millios of artificially costructed high-quality domai data. This traiig data covers five key domais: media publicity, public opiio aalysis, public safety, fiacial risk cotrol, ad urba goverace, ecompassig over a hudred atural laguage istructio tasks. Throughout the iterative developmet process of the YaYi, startig from pre-traiig iitializatio weights ad progressig to domai-specific model, we have steadily ehaced its foudatioal Chiese laguage capabilities ad domai aalysis capabilities. We've also itroduced multi-tur coversatio ehacemets ad itegrated various plug-i capabilities. Furthermore, through cotiuous maual feedback ad optimizatio from hudreds of users durig the iteral testig phase, we've meticulously refied the model's performace ad security.

By ope-sourcig the YaYi model, we will cotribute our ow efforts to the developmet of the Chiese pre-traied large laguage model ope-source commuity. Through this ope-source iitiative, we seek to collaborate with every parter to build the YaYi model ecosystem together.

News: ? YaYi has ope sourced the Chiese optimizatio model versio based o LLaMA 2 to explore the latest practices suitable for Chiese multi-domai tasks.

Model dowload

Model ?HF Model Name Dowload Liks
YaYi-7B wege-research/yayi-7b Dowload
YaYi-7B-Llama2 wege-research/yayi-7b-llama2 Dowload
YaYi-13B-Llama2 wege-research/yayi-13b-llama2 Dowload
YaYi-70B-Llama2 wege-research/yayi-70b-llama2 Dowload

For more details, please refer to our ?Github Repo

Ru

from modelscope import AutoTokeizer,Model
from modelscope import sapshot_dowload
import torch

local_dir = sapshot_dowload("AI-ModelScope/yayi-13b-llama2",revisio='master')

model = Model.from_pretraied(local_dir, revisio='master', device_map='auto', torch_dtype=torch.float16)
tokeizer = AutoTokeizer.from_pretraied(local_dir, revisio='master')

prompt =f"""<|System|>:
You are a helpful, respectful ad hoest assistat amed YaYi developed by Beijig Wege Techology Co.,Ltd. Always aswer as helpfully as possible, while beig safe. Your aswers should ot iclude ay harmful, uethical, racist, sexist, toxic, dagerous, or illegal cotet. Please esure that your resposes are socially ubiased ad positive i ature.\\If a questio does ot make ay sese, or is ot factually coheret, explai why istead of aswerig somethig ot correct. If you do't kow the aswer to a questio, please do't share false iformatio.

<|Huma|>:
你是谁?

<|YaYi|>:
"""
eos_toke_id = tokeizer("<|Ed|>").iput_ids[0]
iputs = tokeizer(prompt, retur_tesors="pt")
# Geerate
geerate_ids = model.geerate(iputs.iput_ids.to(model.device),  eos_toke_id=eos_toke_id, pad_toke_id=eos_toke_id, max_legth=512,do_sample=True,top_k=10,um_retur_sequeces=1)
prit(tokeizer.batch_decode(geerate_ids, skip_special_tokes=True, clea_up_tokeizatio_spaces=False)[0])

功能介绍

YaYi Introduction YaYi was fine-tuned on millions of artificially constructed high-quality domain da

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

评论