Downloads · 30 days
14
14% of all-time downloads
Kendamarron/Tokara-0.5B-Chat-v0.1
Tokara-0.5B-Chat-v0.1 is a text generation model from Kendamarron. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as other.
Qwen/Qwen1.5-0.5Bを日英データ5Bトークンで継続事前学習したTokara-0.5B-v0.1にchat vectorで対話能力を加えたモデルになります。
Downloads · 30 days
14
14% of all-time downloads
All-time downloads
101
Public
Parameters
464M
1.9 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors928 MB · 99%
From the Hugging Face model README
Qwen/Qwen1.5-0.5Bを日英データ5Bトークンで継続事前学習したTokara-0.5B-v0.1にchat vectorで対話能力を加えたモデルになります。
0.5Bというモデルサイズにしてはコミュニケーションが行えるモデルになっています。
chat vectorに使ったモデルはマルチターンの学習を行ったモデルになっているので、複数ターンの会話も行えるはずです。
モデルサイズの問題なのか、repetition_penaltyを1.15~1.25くらいにしないと早めに繰り返しが始まります。
詳細はこちらをご覧ください。
Japanese MT-benchの6カテゴリをシングルターンで評価

| Extraction | Humanities | Reasoning | Roleplay | STEM | Writing |
|---|---|---|---|---|---|
| 1.3 | 2.6 | 2.5 | 3.8 | 2.3 | 3.2 |
日本の在来馬であるトカラ馬から
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
device = "cuda"
model = AutoModelForCausalLM.from_pretrained(
'Kendamarron/Tokara-0.5B-Chat-v0.1',
torch_dtype=torch.bfloat16,
device_map=device,
)
tokenizer = AutoTokenizer.from_pretrained('Kendamarron/Tokara-0.5B-Chat-v0.1')
messages = [
{"role": "system", "content": "あなたは誠実で優秀な日本人のアシスタントです。"},
{"role": "user", "content": "野菜は体にいいですか?"}
]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True
)
model_inputs = tokenizer([text], return_tensors="pt").to(device)
generated_ids = model.generate(
model_inputs.input_ids,
max_new_tokens=256,
do_sample=True,
top_p=0.95,
top_k=40,
temperature=0.7,
repetition_penalty=1.1,
pad_token_id=tokenizer.eos_token_id,
eos_token_id=tokenizer.eos_token_id,
no_repeat_ngram_size=2
)
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)
# はい、野食が健康や美容に良いと言われています。身体を健康的なものにするには、バランス良く摂取することが重要です。
# 野球少年であれば、1日500g程度の野味(たんぱく質)を一日3回以上摌る方法があります。また、ビタミンB群やCも含んでおり、お子様向けには食物繊維(食物中含まれる植物性糖)や亜鉛、カリウムなどの栄養素も豊富です。
#
# 一方、過剰な野草農業や化学肥料の使用によって生じる不自然な添加物・残留農薬(有害な生物的散布物)などは、人体にとって害になる可能性がありますので、科学的に根拠のある安全な方法で野生活をしてください。野遊びや野炊き以外にも、季節ごとに特徴ある食材が利用可能ですが、その内容や量は慎重に行われるようにしましょう。ぜひ、手軽に自宅でも楽しめる方法と知識をお伝えできるよう、心から応援いたします!