Downloads · 30 days
6
17% of all-time downloads
YukiTomita-CC/AKU-d_ms-0.5B-chat-v0.1
AKU-d_ms-0.5B-chat-v0.1 is a machine learning model from YukiTomita-CC. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
スクラッチで学習したMistralアーキテクチャの0.5BモデルをさらにSFTとDPOで会話タスクにファインチューニングしたモデルです。
Downloads · 30 days
6
17% of all-time downloads
All-time downloads
36
Public
Parameters
519M
2.1 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors2.1 GB · 100%
From the Hugging Face model README
スクラッチで学習したMistralアーキテクチャの0.5BモデルをさらにSFTとDPOで会話タスクにファインチューニングしたモデルです。
開発の経緯や開発時のメモ書きは下記のURLを参照ください。 Zenn_記事
pip install transformers sentencepiece protobuf
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
model_name = "YukiTomita-CC/AKU-d_ms-0.5B-chat-v0.1"
model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.float32, device_map="auto").to("cuda")
tokenizer = AutoTokenizer.from_pretrained(model_name, use_fast=False)
messages = [
{"role": "user", "content": "好きな食べ物は何ですか?"}
]
input_ids = tokenizer.apply_chat_template(
messages,
return_tensors="pt",
).to(model.device)
outputs = model.generate(input_ids, max_new_tokens=128, do_sample=True, top_p=0.9, top_k=50, num_return_sequences=5)
for output in outputs:
print(tokenizer.decode(output[input_ids.shape[-1]:], skip_special_tokens=True))
messagesは5ターン以下(len(messages)<=10)を推奨します。