Text Generation
Transformers
Safetensors
Chinese
English
qwen3
mental-health
psychological-counseling
chinese
long-context
dialogue
campus-counseling
conversational
text-generation-inference
Instructions to use EdwinUstb/CPCD-Chat-4B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use EdwinUstb/CPCD-Chat-4B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="EdwinUstb/CPCD-Chat-4B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("EdwinUstb/CPCD-Chat-4B") model = AutoModelForCausalLM.from_pretrained("EdwinUstb/CPCD-Chat-4B") 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 EdwinUstb/CPCD-Chat-4B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "EdwinUstb/CPCD-Chat-4B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "EdwinUstb/CPCD-Chat-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/EdwinUstb/CPCD-Chat-4B
- SGLang
How to use EdwinUstb/CPCD-Chat-4B 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 "EdwinUstb/CPCD-Chat-4B" \ --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": "EdwinUstb/CPCD-Chat-4B", "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 "EdwinUstb/CPCD-Chat-4B" \ --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": "EdwinUstb/CPCD-Chat-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use EdwinUstb/CPCD-Chat-4B with Docker Model Runner:
docker model run hf.co/EdwinUstb/CPCD-Chat-4B
| license: apache-2.0 | |
| language: | |
| - zh | |
| - en | |
| library_name: transformers | |
| pipeline_tag: text-generation | |
| base_model: Qwen/Qwen3-4B-Base | |
| tags: | |
| - qwen3 | |
| - mental-health | |
| - psychological-counseling | |
| - chinese | |
| - long-context | |
| - dialogue | |
| - campus-counseling | |
| # CPCD-Chat-8B | |
| CPCD-Chat-8B is a Chinese long-horizon campus psychological counseling dialogue model developed as part of the **Psy-Chronicle** project. | |
| - **Model page**: https://huggingface.co/EdwinUstb/CPCD-Chat-4B | |
| - **Project GitHub**: https://github.com/EdwinUSTB/Psy-Chronicle | |
| - **The Hugging Face paper URL**: https://huggingface.co/papers/2605.22140 | |
| - **The arXiv URL**: https://arxiv.org/abs/2605.22140 | |
| ## Model Description | |
| CPCD-Chat-8B is fine-tuned from **Qwen3-4B-Base** on CPCD, a synthetic Chinese long-horizon campus psychological counseling dialogue dataset. | |
| The model is designed for research on: | |
| - long-horizon psychological counseling dialogue generation; | |
| - campus mental-health support scenarios; | |
| - cross-session counseling memory; | |
| - student stress-event evolution; | |
| - temporal-causal reasoning in counseling conversations. | |
| ## Dataset | |
| The model is trained on **CPCD**, a Chinese long-horizon dialogue dataset for college psychological counseling scenarios. | |
| CPCD is generated by the Psy-Chronicle framework, which constructs: | |
| 1. structured student profiles; | |
| 2. semester-level temporal stress event graphs; | |
| 3. cross-session counseling dialogues; | |
| 4. structured memory summaries. | |
| Dataset statistics: | |
| | Component | Value | | |
| |---|---:| | |
| | Student profiles | 100 | | |
| | Counseling dialogue units | 90,000 | | |
| | Chinese characters | ~11.45M | | |
| | Scenario | Chinese campus psychological counseling | | |
| ## Psy-Chronicle Framework | |
| Psy-Chronicle synthesizes long-horizon counseling trajectories through a structured pipeline: | |
| ```text | |
| Student Profile | |
| ↓ | |
| Temporal Stress Event Graph | |
| ↓ | |
| Cross-session Counseling Simulation | |
| ↓ | |
| Structured Memory Update | |
| ↓ | |
| CPCD Dataset / CPCD-Bench | |
| ``` | |
| Unlike single-turn or short multi-turn counseling datasets, Psy-Chronicle focuses on how college students' psychological distress accumulates, interacts, and evolves across a semester. | |
| ## CPCD-Bench | |
| CPCD-Bench evaluates long-horizon campus counseling capabilities from three dimensions: | |
| | Task | Description | | |
| |---|---| | |
| | Session-level Response | Generate appropriate counselor responses using current context and historical memory | | |
| | Memory Recall | Recall factual information from long counseling histories | | |
| | Temporal-Causal Reasoning | Analyze chronological event development and causal relationships | | |
| ## Usage | |
| ```python | |
| from transformers import AutoTokenizer, AutoModelForCausalLM | |
| import torch | |
| model_name = "EdwinUstb/CPCD-Chat-4B" | |
| tokenizer = AutoTokenizer.from_pretrained( | |
| model_name, | |
| trust_remote_code=True | |
| ) | |
| model = AutoModelForCausalLM.from_pretrained( | |
| model_name, | |
| torch_dtype=torch.bfloat16, | |
| device_map="auto", | |
| trust_remote_code=True | |
| ) | |
| messages = [ | |
| { | |
| "role": "user", | |
| "content": "我最近因为学业和家庭压力感到很焦虑,不知道该怎么办。" | |
| } | |
| ] | |
| text = tokenizer.apply_chat_template( | |
| messages, | |
| tokenize=False, | |
| add_generation_prompt=True | |
| ) | |
| inputs = tokenizer([text], return_tensors="pt").to(model.device) | |
| outputs = model.generate( | |
| **inputs, | |
| max_new_tokens=512, | |
| temperature=0.7, | |
| top_p=0.9 | |
| ) | |
| response = tokenizer.decode( | |
| outputs[0][inputs.input_ids.shape[-1]:], | |
| skip_special_tokens=True | |
| ) | |
| print(response) | |
| ``` | |
| ## Intended Use | |
| This model is intended for research on: | |
| - psychological counseling dialogue modeling; | |
| - long-horizon dialogue generation; | |
| - cross-session memory modeling; | |
| - campus mental-health support datasets; | |
| - temporal-causal reasoning in counseling scenarios. | |
| ## Limitations | |
| CPCD-Chat-8B is trained on synthetic counseling data. It may generate responses that are incomplete, overly generic, or inappropriate in high-risk mental-health situations. | |
| The model should **not** be used as a substitute for professional psychological counseling, clinical diagnosis, or treatment. | |
| ## Ethical Considerations | |
| This model is released for research and evaluation purposes only. | |
| Users should be aware that: | |
| - the training data are synthetic and do not represent real counseling records; | |
| - the model may fail to detect or properly handle crisis situations; | |
| - any deployment-oriented use should include professional review, safety monitoring, and clear user-facing disclaimers. | |
| ## Citation | |
| If you find this model or project useful, please cite: | |
| ```bibtex | |
| @misc{gou2026psychronicle, | |
| title = {Psy-Chronicle: A Structured Pipeline for Synthesizing Long-Horizon Campus Psychological Counseling Dialogues}, | |
| author = {Chaogui Gou and Jiarui Liang}, | |
| year = {2026}, | |
| note = {Preprint}, | |
| url = {https://github.com/EdwinUSTB/Psy-Chronicle} | |
| } | |
| ``` | |
| ## License | |
| This model is released under the Apache License 2.0. | |