Uploaded model

Usage

from transformers import AutoTokenizer, AutoModelForCausalLM
import torch

tokenizer = AutoTokenizer.from_pretrained(
  "taoki/Qwen2.5-Coder-7B-Instruct_mCot-ja-250-GRPO-qlora-merge"
)
model = AutoModelForCausalLM.from_pretrained(
  "taoki/Qwen2.5-Coder-7B-Instruct_mCot-ja-250-GRPO-qlora-merge"
)

if torch.cuda.is_available():
    model = model.to("cuda")

SYSTEM_PROMPT = """
以下の形式で応答しなさい:
<think>
...
</think>
<answer>
...
</answer>
"""

prompt="2つの数字を比較しなさい。9.9と9.11どちらが大きいですか?"

messages = [
    {"role": "system", "content": SYSTEM_PROMPT},
    {"role": "user", "content": prompt}
]
text = tokenizer.apply_chat_template(
    messages,
    tokenize=False,
    add_generation_prompt=True
)
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
generated_ids = model.generate(
    **model_inputs,
    max_new_tokens=1024
)
generated_ids = [
    output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
]

response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
print(response)

Output

<think>
9.9と9.11を比較します。
まず、整数部分を比較します。両方とも9なので、次に小数部分を比較します。
9.9の小数部分は0.9、9.11の小数部分は0.11です。
0.9は0.11より大きいです。
したがって、9.9が9.11より大きいです。
</think>
<answer>
9.9が9.11より大きいです。
</answer>
Downloads last month
28
Safetensors
Model size
7.62B params
Tensor type
BF16
·
Inference Providers NEW
This model is not currently available via any of the supported Inference Providers.

Model tree for taoki/Qwen2.5-Coder-7B-Instruct_mCot-ja-250-GRPO-qlora-merge

Base model

Qwen/Qwen2.5-7B
Finetuned
(52)
this model

Dataset used to train taoki/Qwen2.5-Coder-7B-Instruct_mCot-ja-250-GRPO-qlora-merge