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. For more details, please refer to our ?Github Repo。YaYi
Itroductio
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
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])
点击空白处退出提示
评论