Downloads · 30 days
9K
5% of all-time downloads
UnicomLLM/Unichat-llama3-Chinese-8B-28K
Unichat-llama3-Chinese-8B-28K is a text generation model from UnicomLLM. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
中国联通AI创新中心发布业界第一个llama3中文指令微调模型长文本版本,全参数微调(非lora/longlora),2024年4月26日19点 本模型以Meta Llama 3为基础,增加中文数据进行训练,实现llama3模型高质量中文问答 此模型上下文原生长度28K 基础模型 Meta-Llama-3-8B
Downloads · 30 days
9K
5% of all-time downloads
All-time downloads
173K
Public
Repo size
32.1 GB
Likes
15
Public
Click a slice to open those files.
.bin16.1 GB · 100%
From the Hugging Face model README
五军营:由骑兵和步兵组成,分为中军、左军、左掖军、右掖军、右哨军,担任攻击的主力。
三千营:由投降的蒙古骑兵组成,主要是以雇佣兵为主的。下属全部都是骑兵,这支骑兵部队人数虽然不多,却是朱棣手下最为强悍的骑兵力量,他们在战争中主要担任突击的角色。
神机营:使用火炮和火铳等火器为主的部队,是明朝政府的炮兵部队。朱棣同志之所以要组建这样的一支部队,那是有着深刻原因的。
所以,明朝三大营的组成和职责是:五军营负责攻击,三千营负责突击,神机营负责使用火器进行打击。
import transformers
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
model_id = "UnicomAI/Unichat-llama3-Chinese-8B-28K"
pipeline = transformers.pipeline(
"text-generation",
model=model_id,
model_kwargs={"torch_dtype": torch.bfloat16},
device="cuda",
)
messages = [
{"role": "system", "content": "A chat between a curious user and an artificial intelligence assistant.The assistant gives helpful, detailed, and polite answers to the user's questions."},
{"role": "user", "content": "你是谁"},
]
prompt = pipeline.tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True
)
terminators = [
pipeline.tokenizer.eos_token_id,
pipeline.tokenizer.convert_tokens_to_ids("<|eot_id|>")
]
outputs = pipeline(
prompt,
max_new_tokens=2048,
eos_token_id=terminators,
do_sample=True,
temperature=0.6,
top_p=1,
repetition_penalty=1.15
)
print(outputs[0]["generated_text"][len(prompt):])
更多模型,数据集和训练相关细节请参考: