Instructions to use Aratako/calm3-22b-RP with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Aratako/calm3-22b-RP with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Aratako/calm3-22b-RP") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Aratako/calm3-22b-RP") model = AutoModelForCausalLM.from_pretrained("Aratako/calm3-22b-RP") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use Aratako/calm3-22b-RP with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Aratako/calm3-22b-RP" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Aratako/calm3-22b-RP", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Aratako/calm3-22b-RP
- SGLang
How to use Aratako/calm3-22b-RP with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Aratako/calm3-22b-RP" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Aratako/calm3-22b-RP", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Aratako/calm3-22b-RP" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Aratako/calm3-22b-RP", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Aratako/calm3-22b-RP with Docker Model Runner:
docker model run hf.co/Aratako/calm3-22b-RP
calm3-22b-RP
GGUF版はこちら/Click here for the GGUF version
また、こちらで本モデルのデモを公開しています。ぜひお試しください。
概要
This is a merge of pre-trained language models created using mergekit.
cyberagent/calm3-22b-chatと、これをベースとしてロールプレイ用にファインチューニングしたモデルであるAratako/calm3-22b-RP-v0.1をマージして作成したモデルです。
利用した学習データセットやパラメータ等の詳細は元モデルのモデルカードを参照してください。
プロンプトフォーマット
元モデルから変更なく、ChatMLのフォーマットでご利用ください。以下は2ターン目の会話を行う際の形式です。
<|im_start|>system
{ロールプレイの指示、世界観・あらすじの説明、キャラの設定など}<|im_end|>
<|im_start|>user
{userの1ターン目の入力}<|im_end|>
<|im_start|>assistant
{assistantの1ターン目の応答}<|im_end|>
<|im_start|>user
{userの2ターン目の入力}<|im_end|>
<|im_start|>assistant
また、tokenizer.apply_chat_template()を使って自動で成形することも可能です。
tokenizer = AutoTokenizer.from_pretrained("Aratako/calm3-22b-RP")
messages = [
{"role": "system", "content": "{ロールプレイの指示、世界観・あらすじの説明、キャラの設定など}"},
{"role": "user", "content": "{userの1ターン目の入力}"},
{"role": "assistant", "content": "{assistantの1ターン目の入力}"},
{"role": "user", "content": "{userの2ターン目の入力}"}
]
prompt = tokenizer.apply_chat_template(messages, add_generation_prompt=True, tokenize=False)
マージの詳細
マージに利用しているモデルは以下の通りです。
また、mergekitのconfigは以下の通りです。
models:
- model: cyberagent/calm3-22b-chat
# no parameters necessary for base model
- model: Aratako/calm3-22b-RP-v0.1
parameters:
weight: 0.5
merge_method: breadcrumbs
base_model: cyberagent/calm3-22b-chat
dtype: bfloat16
tokenizer_source: base
parameters:
density: 0.9
gamma: 0.01
ライセンス
本モデルの学習データにはOpenAI社のGPT-4o-miniの出力やAnthropic社のClaude 3.5 Sonnetの出力が含まれるため、これらの競合となるサービスには本モデルは利用できません。 そのため、本モデルはCC-BY-NC-SA 4.0の元配布します。
- Downloads last month
- 4