DataPilot/ArrowMint-Gemma3-4B-ChocoMint-code

Overview

DataPilot/ArrowMint-Gemma3-4B-ChocoMint-code は、Google の google/gemma-3-4b-it をベースモデルとして、Unsloth ライブラリと合成データセットを用いてファインチューニングされたモデルです。このモデルは、特に コード生成およびコード関連タスクの性能向上 を目的としてトレーニングされました。

ベースモデルである Gemma 3 4B IT は、テキストと画像のマルチモーダル入力に対応し、テキストを出力する能力を持つ軽量な最先端のオープンモデルファミリーの一部です。ArrowMint はその能力を継承しつつ、コードに特化したチューニングが施されています。

主な特徴:

  • ベースモデル: google/gemma-3-4b-it
  • トレーニング: Unsloth を使用し、効率的なファインチューニングを実施
  • データセット: コード性能向上を目的とした合成データセットを利用
  • 目的: コード生成、コード補完、コード説明、バグ修正などのタスクにおける性能向上

How to use

このモデルは以下の方法で使えます。

# pip install accelerate
# pip install -U transformers

from transformers import AutoProcessor, Gemma3ForConditionalGeneration
import torch

model_id = "DataPilot/ArrowMint-Gemma3-4B-ChocoMint-code"

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": "strawberryのRを数えるコードをPythonで考えてください。"}
        ]
    }
]

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)

License

このモデルは、ベースモデルである google/gemma-3-4b-it のライセンスに基づいています。 詳細については、Gemma Terms of Use を参照してください。

派生モデルとしての DataPilot/ArrowMint-Gemma3-4B-ChocoMint-code の利用にあたっては、ベースモデルのライセンス条件を遵守してください。

Downloads last month
7
Safetensors
Model size
4.3B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for DataPilot/ArrowMint-Gemma3-4B-ChocoMint-code

Finetuned
(62)
this model

Collection including DataPilot/ArrowMint-Gemma3-4B-ChocoMint-code