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-8B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use EdwinUstb/CPCD-Chat-8B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="EdwinUstb/CPCD-Chat-8B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("EdwinUstb/CPCD-Chat-8B") model = AutoModelForCausalLM.from_pretrained("EdwinUstb/CPCD-Chat-8B") 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 Settings
- vLLM
How to use EdwinUstb/CPCD-Chat-8B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "EdwinUstb/CPCD-Chat-8B" # 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-8B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/EdwinUstb/CPCD-Chat-8B
- SGLang
How to use EdwinUstb/CPCD-Chat-8B 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-8B" \ --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-8B", "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-8B" \ --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-8B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use EdwinUstb/CPCD-Chat-8B with Docker Model Runner:
docker model run hf.co/EdwinUstb/CPCD-Chat-8B
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,52 +1,178 @@
|
|
| 1 |
---
|
| 2 |
-
frameworks:
|
| 3 |
-
- Pytorch
|
| 4 |
license: apache-2.0
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
-
#
|
| 10 |
-
##如 gpt、phi、llama、chatglm、baichuan 等
|
| 11 |
-
#- gpt
|
| 12 |
|
| 13 |
-
|
| 14 |
-
##如 nlp、cv、audio、multi-modal
|
| 15 |
-
#- nlp
|
| 16 |
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
#- cn
|
| 20 |
|
| 21 |
-
#
|
| 22 |
-
##如 CIDEr、Blue、ROUGE 等
|
| 23 |
-
#- CIDEr
|
| 24 |
|
| 25 |
-
|
| 26 |
-
##各种自定义,包括 pretrained、fine-tuned、instruction-tuned、RL-tuned 等训练方法和其他
|
| 27 |
-
#- pretrained
|
| 28 |
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
--
|
| 33 |
-
|
| 34 |
-
|
|
|
|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 7 |
+
pipeline_tag: text-generation
|
| 8 |
+
base_model: Qwen/Qwen3-8B-Base
|
| 9 |
+
tags:
|
| 10 |
+
- qwen3
|
| 11 |
+
- mental-health
|
| 12 |
+
- psychological-counseling
|
| 13 |
+
- chinese
|
| 14 |
+
- long-context
|
| 15 |
+
- dialogue
|
| 16 |
+
- campus-counseling
|
| 17 |
+
---
|
| 18 |
|
| 19 |
+
# CPCD-Chat-8B
|
|
|
|
|
|
|
| 20 |
|
| 21 |
+
CPCD-Chat-8B is a Chinese long-horizon campus psychological counseling dialogue model developed as part of the **Psy-Chronicle** project.
|
|
|
|
|
|
|
| 22 |
|
| 23 |
+
- **Model page**: https://huggingface.co/EdwinUstb/CPCD-Chat-8B
|
| 24 |
+
- **Project GitHub**: https://github.com/EdwinUSTB/Psy-Chronicle
|
|
|
|
| 25 |
|
| 26 |
+
## Model Description
|
|
|
|
|
|
|
| 27 |
|
| 28 |
+
CPCD-Chat-8B is fine-tuned from **Qwen3-8B-Base** on CPCD, a synthetic Chinese long-horizon campus psychological counseling dialogue dataset.
|
|
|
|
|
|
|
| 29 |
|
| 30 |
+
The model is designed for research on:
|
| 31 |
+
|
| 32 |
+
- long-horizon psychological counseling dialogue generation;
|
| 33 |
+
- campus mental-health support scenarios;
|
| 34 |
+
- cross-session counseling memory;
|
| 35 |
+
- student stress-event evolution;
|
| 36 |
+
- temporal-causal reasoning in counseling conversations.
|
| 37 |
+
|
| 38 |
+
## Dataset
|
| 39 |
+
|
| 40 |
+
The model is trained on **CPCD**, a Chinese long-horizon dialogue dataset for college psychological counseling scenarios.
|
| 41 |
+
|
| 42 |
+
CPCD is generated by the Psy-Chronicle framework, which constructs:
|
| 43 |
+
|
| 44 |
+
1. structured student profiles;
|
| 45 |
+
2. semester-level temporal stress event graphs;
|
| 46 |
+
3. cross-session counseling dialogues;
|
| 47 |
+
4. structured memory summaries.
|
| 48 |
+
|
| 49 |
+
Dataset statistics:
|
| 50 |
+
|
| 51 |
+
| Component | Value |
|
| 52 |
+
|---|---:|
|
| 53 |
+
| Student profiles | 100 |
|
| 54 |
+
| Counseling dialogue units | 90,000 |
|
| 55 |
+
| Chinese characters | ~11.45M |
|
| 56 |
+
| Scenario | Chinese campus psychological counseling |
|
| 57 |
+
|
| 58 |
+
## Psy-Chronicle Framework
|
| 59 |
+
|
| 60 |
+
Psy-Chronicle synthesizes long-horizon counseling trajectories through a structured pipeline:
|
| 61 |
|
| 62 |
+
```text
|
| 63 |
+
Student Profile
|
| 64 |
+
↓
|
| 65 |
+
Temporal Stress Event Graph
|
| 66 |
+
↓
|
| 67 |
+
Cross-session Counseling Simulation
|
| 68 |
+
↓
|
| 69 |
+
Structured Memory Update
|
| 70 |
+
↓
|
| 71 |
+
CPCD Dataset / CPCD-Bench
|
| 72 |
```
|
| 73 |
+
|
| 74 |
+
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.
|
| 75 |
+
|
| 76 |
+
## CPCD-Bench
|
| 77 |
+
|
| 78 |
+
CPCD-Bench evaluates long-horizon campus counseling capabilities from three dimensions:
|
| 79 |
+
|
| 80 |
+
| Task | Description |
|
| 81 |
+
|---|---|
|
| 82 |
+
| Session-level Response | Generate appropriate counselor responses using current context and historical memory |
|
| 83 |
+
| Memory Recall | Recall factual information from long counseling histories |
|
| 84 |
+
| Temporal-Causal Reasoning | Analyze chronological event development and causal relationships |
|
| 85 |
+
|
| 86 |
+
## Usage
|
| 87 |
+
|
| 88 |
```python
|
| 89 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 90 |
+
import torch
|
| 91 |
+
|
| 92 |
+
model_name = "EdwinUstb/CPCD-Chat-8B"
|
| 93 |
+
|
| 94 |
+
tokenizer = AutoTokenizer.from_pretrained(
|
| 95 |
+
model_name,
|
| 96 |
+
trust_remote_code=True
|
| 97 |
+
)
|
| 98 |
+
|
| 99 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 100 |
+
model_name,
|
| 101 |
+
torch_dtype=torch.bfloat16,
|
| 102 |
+
device_map="auto",
|
| 103 |
+
trust_remote_code=True
|
| 104 |
+
)
|
| 105 |
+
|
| 106 |
+
messages = [
|
| 107 |
+
{
|
| 108 |
+
"role": "user",
|
| 109 |
+
"content": "我最近因为学业和家庭压力感到很焦虑,不知道该怎么办。"
|
| 110 |
+
}
|
| 111 |
+
]
|
| 112 |
+
|
| 113 |
+
text = tokenizer.apply_chat_template(
|
| 114 |
+
messages,
|
| 115 |
+
tokenize=False,
|
| 116 |
+
add_generation_prompt=True
|
| 117 |
+
)
|
| 118 |
+
|
| 119 |
+
inputs = tokenizer([text], return_tensors="pt").to(model.device)
|
| 120 |
+
|
| 121 |
+
outputs = model.generate(
|
| 122 |
+
**inputs,
|
| 123 |
+
max_new_tokens=512,
|
| 124 |
+
temperature=0.7,
|
| 125 |
+
top_p=0.9
|
| 126 |
+
)
|
| 127 |
+
|
| 128 |
+
response = tokenizer.decode(
|
| 129 |
+
outputs[0][inputs.input_ids.shape[-1]:],
|
| 130 |
+
skip_special_tokens=True
|
| 131 |
+
)
|
| 132 |
+
|
| 133 |
+
print(response)
|
| 134 |
```
|
| 135 |
+
|
| 136 |
+
## Intended Use
|
| 137 |
+
|
| 138 |
+
This model is intended for research on:
|
| 139 |
+
|
| 140 |
+
- psychological counseling dialogue modeling;
|
| 141 |
+
- long-horizon dialogue generation;
|
| 142 |
+
- cross-session memory modeling;
|
| 143 |
+
- campus mental-health support datasets;
|
| 144 |
+
- temporal-causal reasoning in counseling scenarios.
|
| 145 |
+
|
| 146 |
+
## Limitations
|
| 147 |
+
|
| 148 |
+
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.
|
| 149 |
+
|
| 150 |
+
The model should **not** be used as a substitute for professional psychological counseling, clinical diagnosis, or treatment.
|
| 151 |
+
|
| 152 |
+
## Ethical Considerations
|
| 153 |
+
|
| 154 |
+
This model is released for research and evaluation purposes only.
|
| 155 |
+
|
| 156 |
+
Users should be aware that:
|
| 157 |
+
|
| 158 |
+
- the training data are synthetic and do not represent real counseling records;
|
| 159 |
+
- the model may fail to detect or properly handle crisis situations;
|
| 160 |
+
- any deployment-oriented use should include professional review, safety monitoring, and clear user-facing disclaimers.
|
| 161 |
+
|
| 162 |
+
## Citation
|
| 163 |
+
|
| 164 |
+
If you find this model or project useful, please cite:
|
| 165 |
+
|
| 166 |
+
```bibtex
|
| 167 |
+
@misc{gou2026psychronicle,
|
| 168 |
+
title = {Psy-Chronicle: A Structured Pipeline for Synthesizing Long-Horizon Campus Psychological Counseling Dialogues},
|
| 169 |
+
author = {Chaogui Gou and Jiarui Liang},
|
| 170 |
+
year = {2026},
|
| 171 |
+
note = {Preprint},
|
| 172 |
+
url = {https://github.com/EdwinUSTB/Psy-Chronicle}
|
| 173 |
+
}
|
| 174 |
```
|
| 175 |
|
| 176 |
+
## License
|
| 177 |
+
|
| 178 |
+
This model is released under the Apache License 2.0.
|