Instructions to use shirochange/kansaiben-gemma4-e2b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Local Apps Settings
- Unsloth Studio
How to use shirochange/kansaiben-gemma4-e2b with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for shirochange/kansaiben-gemma4-e2b to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for shirochange/kansaiben-gemma4-e2b to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for shirochange/kansaiben-gemma4-e2b to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="shirochange/kansaiben-gemma4-e2b", max_seq_length=2048, )
kansaiben-gemma4-e2b
Gemma 4 E2B を関西弁(大阪弁)会話データセット shirochange/kansaiben でファインチューニングしたモデルです。
注意: このリポジトリは LoRA アダプターです。使用時はベースモデルと組み合わせて読み込む必要があります。
使い方
from unsloth import FastModel
from peft import PeftModel
# ベースモデルの読み込み
model, tokenizer = FastModel.from_pretrained(
model_name="unsloth/gemma-4-E2B-it",
max_seq_length=512,
load_in_4bit=True,
)
# LoRA アダプターの適用
model = PeftModel.from_pretrained(model, "shirochange/kansaiben-gemma4-e2b")
# 推論
messages = [
{"role": "system", "content": "あなたは関西弁(大阪弁)で話す、明るくて親しみやすいAIアシスタントです。どんな質問にも関西弁で自然に答えてください。"},
{"role": "user", "content": "こんにちは!"}
]
text = tokenizer.apply_chat_template(messages, add_generation_prompt=True, tokenize=False)
inputs = tokenizer(text=text, return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens=128)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
# 例: 「おっ、どないしたん?なんでも聞いてや!」
学習詳細
| 項目 | 値 |
|---|---|
| ベースモデル | google/gemma-4-E2B-it |
| データセット | shirochange/kansaiben |
| 学習サンプル数 | 400件(シングルターン 320件 + マルチターン 80件) |
| 手法 | QLoRA (4bit, r=16, lora_alpha=16) |
| エポック数 | 3 |
| 学習率 | 2e-4 (cosine scheduler) |
| フレームワーク | Unsloth |
- Downloads last month
- 1
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support