How to use from
Docker Model Runner
docker model run hf.co/UEC-InabaLab/CounselTrajLM-Qwen2.5-7B
Quick Links

CounselTrajLM โ€” Qwen2.5-7B

๐Ÿ“„ Paper: arXiv:2611.24168

CounselTrajLM is a Chinese counseling dialogue model fine-tuned on CounselTrajD to generate the next counselor response from dialogue history. This version uses Qwen2.5-7B-Instruct as its base.

This repository contains the complete merged BF16 model in nine safetensors shards, together with its tokenizer, chat template, inference script, and checksums. It can be loaded directly with Transformers.

Model and training details

Item Value
Base model Qwen/Qwen2.5-7B-Instruct
Base revision a09a35458c702b33eeacc393d103063234e8bc28
Training data CounselTrajD; dialogue-disjoint 90/10 train/validation split
Supervised training examples 425,679
Validation examples 47,528
Fine-tuning method QLoRA; adapter merged into the unquantized BF16 base for release
LoRA rank / alpha / dropout 32 / 64 / 0.05
Learning rate 1e-5
Schedule / warmup ratio Cosine / 0.06
Epochs 3; final-epoch export
Effective batch size 16
Maximum training sequence length 2,048 tokens
Release format Merged BF16 safetensors

Validation was used for monitoring. The released model is the final epoch. See training_summary.json for the recorded settings.

Usage

The repository is public and can be downloaded without authentication. Install the dependencies in requirements.txt.

pip install -r requirements.txt
python generate_reply.py --messages examples/history.json

The script accepts a JSON list of chat messages with role and content keys. Use user for client messages and assistant for counselor messages, ending with a client message. It adds the training system instruction if none is supplied. The example dialogue is newly written for demonstrating inference.

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "UEC-InabaLab/CounselTrajLM-Qwen2.5-7B"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
    model_id, dtype=torch.bfloat16, device_map="auto"
)
messages = [
    {"role": "system", "content": "ไฝ ๆ˜ฏไธ€ๅไธ“ไธšใ€ๆธฉๅ’Œใ€่‡ช็„ถ็š„็บฟไธŠๅฟƒ็†ๅ’จ่ฏขๅธˆใ€‚่ฏทๆ นๆฎๅฏน่ฏๅކๅฒ็”Ÿๆˆไธ‹ไธ€ๅฅๅ’จ่ฏขๅธˆๅ›žๅคใ€‚ๅ›žๅคๅชๅ†™ๅ’จ่ฏขๅธˆ่ฆ่ฏด็š„่ฏ๏ผŒไธ่ฆๅ†™่ฏด่ฏไบบๅ็งฐ๏ผŒไธ่ฆๅ†™ๅฏน่ฏๆ ‡็ญพใ€‚"},
    {"role": "user", "content": "ๆœ€่ฟ‘ๅทฅไฝœไปปๅŠกๅพˆๅคš๏ผŒไธ‹็ญไปฅๅŽไนŸไธ€็›ดๅœจๆƒณๅทฅไฝœ็š„ไบ‹๏ผŒๅพˆ้šพๆ”พๆพใ€‚"},
]
prompt = tokenizer.apply_chat_template(
    messages, tokenize=False, add_generation_prompt=True
)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.inference_mode():
    output = model.generate(
        **inputs, max_new_tokens=160, do_sample=True,
        temperature=0.7, top_p=0.8, top_k=20, repetition_penalty=1.05,
    )
print(tokenizer.decode(output[0, inputs.input_ids.shape[-1]:], skip_special_tokens=True))

The weights occupy approximately 15.2 GB, with additional memory required for inference. The release was checked with Transformers 5.13.0, PyTorch 2.5.1, Accelerate 1.13.0, and safetensors 0.8.0. Use SHA256SUMS and validation.json to check the release files and validation status.

Intended use and limitations

The model is intended for research on Chinese counseling dialogue generation. Its training data are synthetic. Generated responses may be inaccurate, inappropriate, or unsafe, and the model is not a substitute for professional mental health care.

The model is released under Apache-2.0; see LICENSE. The source data's licensing and attribution information is provided in the CounselTraj repository.

Citation

@inproceedings{qi-inaba-2027-counseltraj,
    title = "{CounselTraj}: Synthesizing Process-Aware Psychological Counseling Dialogues via Dialogue-Act Trajectory Planning",
    author = "Qi, Zhiyang and Inaba, Michimasa",
    booktitle = "Proceedings of the 20th Conference of the European Chapter of the Association for Computational Linguistics",
    year = "2027",
    url = "https://arxiv.org/abs/2611.24168",
}
Downloads last month
-
Safetensors
Model size
8B params
Tensor type
BF16
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for UEC-InabaLab/CounselTrajLM-Qwen2.5-7B

Base model

Qwen/Qwen2.5-7B
Finetuned
(3,278)
this model

Paper for UEC-InabaLab/CounselTrajLM-Qwen2.5-7B