Sarashina-MoE
Collection
SB intuitionsのsarashinaシリーズをMoEマージしたものです。
•
4 items
•
Updated
DataPilot/sarashina2.2-3Bx8-moe は、sbintuitions/sarashina2.2-3b-instruct-v0.1をベースに、mergekit-moeを用いて8つの専門モデルを統合したMixture of Experts(MoE)型の言語モデルです。各専門モデルが持つ強みを活用し、シングルモデルを超えた多彩で柔軟な応答生成が可能です。
以下は本モデルを利用したテキスト生成の簡単な例です。
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline, set_seed
# モデルのロード
model_name = "DataPilot/sarashina2.2-3Bx8-moe"
model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.bfloat16, device_map="auto")
tokenizer = AutoTokenizer.from_pretrained(model_name)
chat_pipeline = pipeline("text-generation", model=model, tokenizer=tokenizer)
set_seed(123)
# ユーザー入力
user_input = [{"role": "user", "content": "こんにちは。あなたの名前を教えて"}]
# モデルからの応答生成
responses = chat_pipeline(
user_input,
max_length=50,
do_sample=True,
num_return_sequences=3,
)
# 応答を表示
for i, response in enumerate(responses, 1):
print(f"Response {i}: {response['generated_text']}")
# 出力例:
# Response 1: [{'role': 'user', 'content': 'こんにちは。あなたの名前を教えて'}, {'role': 'assistant', 'content': 'Sarashina2と言います。本日のご要件を教えて下さい。'}]
# Response 2: [{'role': 'user', 'content': 'こんにちは。あなたの名前を教えて'}, {'role': 'assistant', 'content': 'こんにちは!私の名前はSarashina2です。今日はどうしましたか?'}]
# Response 3: [{'role': 'user', 'content': 'こんにちは。あなたの名前を教えて'}, {'role': 'assistant', 'content': 'Sarashina2と言います。本日のご要件を教えて下さい。'}]
本モデルはsbintuitions/sarashina2.2-3b-instruct-v0.1を元に構築されています。元モデルのライセンス条件をご確認の上ご利用ください。また、モデル構築には mergekit-moe を使用しています。
Base model
sbintuitions/sarashina2.2-3b