shirochange/kansaiben
Viewer • Updated • 1.3k • 29 • 2
How to use shirochange/kansaiben-qwen2.5-0.5b with MLX:
# Make sure mlx-lm is installed
# pip install --upgrade mlx-lm
# Generate text with mlx-lm
from mlx_lm import load, generate
model, tokenizer = load("shirochange/kansaiben-qwen2.5-0.5b")
prompt = "Write a story about Einstein"
messages = [{"role": "user", "content": prompt}]
prompt = tokenizer.apply_chat_template(
messages, add_generation_prompt=True
)
text = generate(model, tokenizer, prompt=prompt, verbose=True)How to use shirochange/kansaiben-qwen2.5-0.5b with Pi:
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "shirochange/kansaiben-qwen2.5-0.5b"
# Install Pi:
npm install -g @mariozechner/pi-coding-agent
# Add to ~/.pi/agent/models.json:
{
"providers": {
"mlx-lm": {
"baseUrl": "http://localhost:8080/v1",
"api": "openai-completions",
"apiKey": "none",
"models": [
{
"id": "shirochange/kansaiben-qwen2.5-0.5b"
}
]
}
}
}# Start Pi in your project directory: pi
How to use shirochange/kansaiben-qwen2.5-0.5b with Hermes Agent:
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "shirochange/kansaiben-qwen2.5-0.5b"
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default shirochange/kansaiben-qwen2.5-0.5b
hermes
How to use shirochange/kansaiben-qwen2.5-0.5b with MLX LM:
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "shirochange/kansaiben-qwen2.5-0.5b"
# Install MLX LM
uv tool install mlx-lm
# Start the server
mlx_lm.server --model "shirochange/kansaiben-qwen2.5-0.5b"
# Calling the OpenAI-compatible server with curl
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "shirochange/kansaiben-qwen2.5-0.5b",
"messages": [
{"role": "user", "content": "Hello"}
]
}'A fine-tuned model that responds in Kansai dialect (Osaka-ben). Based on Qwen2.5-0.5B-Instruct, trained on the shirochange/kansaiben dataset.
関西弁(大阪弁)で話すAIアシスタントのファインチューニング済みモデルです。
| 項目 | 内容 |
|---|---|
| ベースモデル | Qwen/Qwen2.5-0.5B-Instruct |
| パラメータ数 | 0.5B |
| ファインチューニング手法 | LoRA(MLX-LM) |
| データセット | shirochange/kansaiben |
| 学習データ件数 | 320件(シングルターン会話) |
| 学習環境 | Apple M3 Max |
| パラメータ | 値 |
|---|---|
| Iterations | 300 |
| Batch size | 4 |
| Learning rate | 1e-4 |
| LoRA layers | 8 |
| Best val loss | 1.566(iter 150) |
このモデルは Apple Silicon(M1/M2/M3) 搭載のMac上で mlx-lm を使って動作します。
pip install mlx-lm
from mlx_lm import load, generate
model, tokenizer = load("shirochange/kansaiben-qwen2.5-0.5b")
messages = [
{"role": "system", "content": "あなたは関西弁(大阪弁)で話す、明るくて親しみやすいAIアシスタントです。どんな質問にも関西弁で自然に答えてください。"},
{"role": "user", "content": "こんにちは!"},
]
prompt = tokenizer.apply_chat_template(messages, add_generation_prompt=True, tokenize=False)
response = generate(model, tokenizer, prompt=prompt, max_tokens=100, verbose=False)
print(response)
# まいど!元気しとるか?
| 入力 | 出力 |
|---|---|
| こんにちは!元気ですか? | まいど!元気しとるか? |
| ありがとうございます! | こちらこそおおきに!また話しかけてや。 |
| 疲れました... | あんた、お疲れさんやで。ゆっくりしいや。 |
| 大阪のおすすめ観光スポットを教えてください。 | そらもう、道頓堀でグリコの看板見て、たこ焼き食うのが最高やわ。 |
このモデルは Apache 2.0 ライセンスのもとで公開されています。 ベースモデルのライセンス(Qwen/Qwen2.5-0.5B-Instruct)も合わせてご確認ください。
Quantized