🚀 ABEJA-Qwen2.5-7b-Japanese-v0.1
ABEJA-Qwen2.5-7b-Japanese-v0.1 是基于 Qwen/Qwen2.5-7B-Instruct 进行日语学习的模型。该模型并非采用常规的持续预训练方式,而是以 abeja/ABEJA-Qwen2.5-32b-Japanese-v0.1 为基础进行蒸馏学习得到的。此外,该模型未进行后训练(Post-Traning),而是通过 ChatVector(Qwen/Qwen2.5-7B-Instruct 与 Qwen/Qwen2.5-7B 的差分向量)提升了指令跟随性能。
如需了解更多详细信息,请参考 ABEJA 的技术博客。
🚀 快速开始
ABEJA-Qwen2.5-7b-Japanese-v0.1 是基于 Qwen/Qwen2.5-7B-Instruct 进行日语学习的模型。该模型并非采用常规的持续预训练方式,而是以 abeja/ABEJA-Qwen2.5-32b-Japanese-v0.1 为基础进行蒸馏学习得到的。此外,该模型未进行后训练(Post-Traning),而是通过 ChatVector(Qwen/Qwen2.5-7B-Instruct 与 Qwen/Qwen2.5-7B 的差分向量)提升了指令跟随性能。
如需了解更多详细信息,请参考 ABEJA 的技术博客。
💻 使用示例
基础用法
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "abeja/ABEJA-Qwen2.5-7b-Japanese-v0.1"
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype="auto",
device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained(model_name)
prompt = "人とAIが協調するためには?"
messages = [
{"role": "system", "content": "You are Qwen, created by Alibaba Cloud. You are a helpful assistant."},
{"role": "user", "content": prompt}
]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True
)
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
generated_ids = model.generate(
**model_inputs,
max_new_tokens=512
)
generated_ids = [
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
]
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
print(response)
📄 许可证
本项目采用 Apache-2.0 许可证。
👨💻 开发者
- Hiroshi Kiyota
- Keisuke Fujimoto
- Kentaro Nakanishi
- Kyo Hattori
- Shinya Otani
- Shogo Muranushi
- Takuma Kume
- Tomoki Manabe
(*按字母顺序排列)
📋 模型信息
属性 |
详情 |
模型类型 |
文本生成 |
基础模型 |
Qwen/Qwen2.5-7B-Instruct |
学习方式 |
基于 abeja/ABEJA-Qwen2.5-32b-Japanese-v0.1 进行蒸馏学习 |
指令跟随性能提升方式 |
通过 ChatVector(Qwen/Qwen2.5-7B-Instruct 与 Qwen/Qwen2.5-7B 的差分向量) |