ArrowMint-series
Collection
Gemma3をベースとしたモデル群
•
5 items
•
Updated
モデルリポジトリ: DataPilot/ArrowMint-Gemma3-4B-ChocoMint-instruct-v0.2
ベースモデル: google/gemma-3-4b-it
DataPilot/ArrowMint-Gemma3-4B-ChocoMint-instruct-v0.2
は、Googleによって開発された強力なマルチモーダルモデルであるgoogle/gemma-3-4b-it
をベースとしてファインチューニングされた指示応答モデルです。
このモデルは、Unslothライブラリと高品質な合成データセットを用いてトレーニングされました。主な目的は、ベースモデルの持つ能力を維持・強化しつつ、特にプロンプト(指示)への追従能力とマルチターン対話における性能を向上させることです。
Gemma 3ファミリーと同様に、テキスト入力と画像入力の両方に対応し、テキスト出力を生成することができます。
このモデルを使用するには、Transformersライブラリ (バージョン 4.50.0 以降) が必要です。
pip install -U transformers accelerate Pillow requests torch
from transformers import AutoProcessor, Gemma3ForConditionalGeneration
from PIL import Image
import requests
import torch
model_id = "DataPilot/ArrowMint-Gemma3-4B-ChocoMint-instruct-v0.2"
model = Gemma3ForConditionalGeneration.from_pretrained(
model_id, device_map="auto"
).eval()
processor = AutoProcessor.from_pretrained(model_id)
messages = [
{
"role": "system",
"content": [{"type": "text", "text": "あなたは素晴らしい日本語アシスタントです。"}]
},
{
"role": "user",
"content": [
{"type": "image", "image": "https://cs.stanford.edu/people/rak248/VG_100K_2/2399540.jpg"},
{"type": "text", "text": "この画像を説明してください。"}
]
}
]
inputs = processor.apply_chat_template(
messages, add_generation_prompt=True, tokenize=True,
return_dict=True, return_tensors="pt"
).to(model.device, dtype=torch.bfloat16)
input_len = inputs["input_ids"].shape[-1]
with torch.inference_mode():
generation = model.generate(**inputs, max_new_tokens=100, do_sample=False)
generation = generation[0][input_len:]
decoded = processor.decode(generation, skip_special_tokens=True)
print(decoded)
from transformers import AutoProcessor, Gemma3ForConditionalGeneration
import torch
model_id = "DataPilot/ArrowMint-Gemma3-4B-ChocoMint-instruct-v0.2"
model = Gemma3ForConditionalGeneration.from_pretrained(
model_id, device_map="auto"
).eval()
processor = AutoProcessor.from_pretrained(model_id)
messages = [
{
"role": "system",
"content": [{"type": "text", "text": "あなたは素晴らしい日本語アシスタントです。"}]
},
{
"role": "user",
"content": [
{"type": "text", "text": "AI言語モデルであるLaMDAが意識があることを主張して弁護士を呼んだとのことです。LaMDAには意識があると思いますか?"}
]
}
]
inputs = processor.apply_chat_template(
messages, add_generation_prompt=True, tokenize=True,
return_dict=True, return_tensors="pt"
).to(model.device, dtype=torch.bfloat16)
input_len = inputs["input_ids"].shape[-1]
with torch.inference_mode():
generation = model.generate(**inputs, max_new_tokens=100, do_sample=False)
generation = generation[0][input_len:]
decoded = processor.decode(generation, skip_special_tokens=True)
print(decoded)
注意点:
torch_dtype=torch.bfloat16
や device_map="auto"
を使用してメモリ使用量を削減・分散することを推奨します。trust_remote_code=True
)。信頼できるソースからモデルをロードしていることを確認してください。google/gemma-3-4b-it
のチャットテンプレートに従うことを推奨します。上記コード例では apply_chat_template
がこれを自動的に処理します。このモデルは、ベースモデルである google/gemma-3-4b-it
のライセンスに基づいています。詳細については、Gemma Terms of Use を参照してください。
派生モデルである DataPilot/ArrowMint-Gemma3-4B-ChocoMint-instruct-v0.2
の利用にあたっては、ベースモデルのライセンス条件、特に利用制限(Gemma Prohibited Use Policy)に従う必要があります。