SMILE: Single-turn to Multi-turn Inclusive Language Expansion via ChatGPT for Mental Health Support
Paper • 2305.00450 • Published
How to use jun10k/Qwen1.5-7B-MeChat with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="jun10k/Qwen1.5-7B-MeChat")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("jun10k/Qwen1.5-7B-MeChat")
model = AutoModelForCausalLM.from_pretrained("jun10k/Qwen1.5-7B-MeChat")
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]:]))How to use jun10k/Qwen1.5-7B-MeChat with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "jun10k/Qwen1.5-7B-MeChat"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "jun10k/Qwen1.5-7B-MeChat",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/jun10k/Qwen1.5-7B-MeChat
How to use jun10k/Qwen1.5-7B-MeChat with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "jun10k/Qwen1.5-7B-MeChat" \
--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": "jun10k/Qwen1.5-7B-MeChat",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'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 "jun10k/Qwen1.5-7B-MeChat" \
--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": "jun10k/Qwen1.5-7B-MeChat",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use jun10k/Qwen1.5-7B-MeChat with Docker Model Runner:
docker model run hf.co/jun10k/Qwen1.5-7B-MeChat
本项目是用Qwen1.5-7B为基础,使用心理健康对话数据集实现微调。仅用于技术研究用途。
本项目的使用来自中文心理健康支持对话 · 数据集(SmileChat) 其具体信息如下
@misc{qiu2023smile,
title={SMILE: Single-turn to Multi-turn Inclusive Language Expansion via ChatGPT for Mental Health Support},
author={Huachuan Qiu and Hongliang He and Shuai Zhang and Anqi Li and Zhenzhong Lan},
year={2023},
eprint={2305.00450},
archivePrefix={arXiv},
primaryClass={cs.CL}
}