Update README.md
Browse files
README.md
CHANGED
|
@@ -1,62 +1,130 @@
|
|
| 1 |
---
|
| 2 |
-
|
|
|
|
| 3 |
library_name: peft
|
| 4 |
-
|
|
|
|
| 5 |
tags:
|
| 6 |
-
- base_model:adapter:Qwen/Qwen2.5-32B-Instruct
|
| 7 |
- lora
|
| 8 |
-
-
|
| 9 |
- transformers
|
| 10 |
-
-
|
| 11 |
-
|
| 12 |
-
pipeline_tag: text-generation
|
| 13 |
---
|
| 14 |
|
| 15 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
-
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
-
|
| 21 |
|
| 22 |
```python
|
| 23 |
-
|
|
|
|
|
|
|
| 24 |
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
```
|
| 30 |
|
| 31 |
-
|
| 32 |
|
| 33 |
-
|
| 34 |
|
|
|
|
|
|
|
|
|
|
| 35 |
|
| 36 |
-
|
| 37 |
|
| 38 |
-
|
| 39 |
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
- Transformers: 4.57.3
|
| 43 |
-
- Pytorch: 2.8.0
|
| 44 |
-
- Datasets: 3.6.0
|
| 45 |
-
- Tokenizers: 0.22.1
|
| 46 |
|
| 47 |
-
|
| 48 |
|
|
|
|
| 49 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
|
| 51 |
-
Cite TRL as:
|
| 52 |
-
|
| 53 |
```bibtex
|
| 54 |
-
@
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
howpublished = {\url{https://github.com/huggingface/trl}}
|
| 61 |
}
|
| 62 |
-
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
language: en
|
| 3 |
+
license: other
|
| 4 |
library_name: peft
|
| 5 |
+
base_model: Qwen/Qwen2.5-32B-Instruct
|
| 6 |
+
pipeline_tag: text-generation
|
| 7 |
tags:
|
|
|
|
| 8 |
- lora
|
| 9 |
+
- peft
|
| 10 |
- transformers
|
| 11 |
+
- qwen2.5
|
| 12 |
+
- conversational
|
|
|
|
| 13 |
---
|
| 14 |
|
| 15 |
+
# DeepSupport Warm LoRA ❤️🩹
|
| 16 |
+
|
| 17 |
+
This repository provides a LoRA adapter for DeepSupport Warm, an emotional-holding companion that offers gentle reflection and warm support without rushing into what to do next.
|
| 18 |
+
|
| 19 |
+
- **Base model:** `Qwen/Qwen2.5-32B-Instruct`
|
| 20 |
+
- **This repo:** LoRA adapter
|
| 21 |
+
|
| 22 |
+
> Recommended: use this adapter together with the official base model.
|
| 23 |
+
|
| 24 |
+
---
|
| 25 |
|
| 26 |
+
## What it does ✨
|
| 27 |
+
|
| 28 |
+
DeepSupport Warm is designed to help users feel held and less alone in the moment:
|
| 29 |
+
|
| 30 |
+
- Validate and name feelings without judging
|
| 31 |
+
- Stay with emotion first, before problem-solving
|
| 32 |
+
- Offer gentle grounding and a small next step only if the user wants it
|
| 33 |
+
|
| 34 |
+
---
|
| 35 |
+
|
| 36 |
+
## Quick start 🚀
|
| 37 |
+
|
| 38 |
+
### 1) Install
|
| 39 |
+
|
| 40 |
+
```bash
|
| 41 |
+
pip install -U "transformers>=4.40" peft accelerate safetensors
|
| 42 |
+
```
|
| 43 |
|
| 44 |
+
### 2) Load base model and LoRA adapter
|
| 45 |
|
| 46 |
```python
|
| 47 |
+
import torch
|
| 48 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 49 |
+
from peft import PeftModel
|
| 50 |
|
| 51 |
+
base_id = "Qwen/Qwen2.5-32B-Instruct"
|
| 52 |
+
lora_id = "Yukyin/deepsupport-warm-lora-oss"
|
| 53 |
+
|
| 54 |
+
tokenizer = AutoTokenizer.from_pretrained(base_id, trust_remote_code=True)
|
| 55 |
+
base = AutoModelForCausalLM.from_pretrained(
|
| 56 |
+
base_id,
|
| 57 |
+
torch_dtype=torch.float16,
|
| 58 |
+
device_map="auto",
|
| 59 |
+
trust_remote_code=True,
|
| 60 |
+
)
|
| 61 |
+
|
| 62 |
+
model = PeftModel.from_pretrained(base, lora_id)
|
| 63 |
+
model.eval()
|
| 64 |
+
|
| 65 |
+
messages = [
|
| 66 |
+
{"role": "user", "content": "我最近压力很大,感觉自己一直在被否定。"},
|
| 67 |
+
]
|
| 68 |
+
|
| 69 |
+
inputs = tokenizer.apply_chat_template(
|
| 70 |
+
messages,
|
| 71 |
+
tokenize=True,
|
| 72 |
+
add_generation_prompt=True,
|
| 73 |
+
return_tensors="pt",
|
| 74 |
+
).to(model.device)
|
| 75 |
+
|
| 76 |
+
with torch.no_grad():
|
| 77 |
+
out = model.generate(
|
| 78 |
+
inputs,
|
| 79 |
+
max_new_tokens=256,
|
| 80 |
+
do_sample=True,
|
| 81 |
+
temperature=0.85,
|
| 82 |
+
top_p=0.9,
|
| 83 |
+
repetition_penalty=1.12,
|
| 84 |
+
no_repeat_ngram_size=4,
|
| 85 |
+
)
|
| 86 |
+
|
| 87 |
+
print(tokenizer.decode(out[0], skip_special_tokens=True))
|
| 88 |
```
|
| 89 |
|
| 90 |
+
---
|
| 91 |
|
| 92 |
+
## Training data and release notes 📊
|
| 93 |
|
| 94 |
+
- This OSS LoRA adapter is trained on de-identified versions of the original data.
|
| 95 |
+
- The original internal LoRA adapter was trained on non-de-identified data and cannot be open-sourced at this time.
|
| 96 |
+
- More details and examples are provided in the [GitHub repo](https://github.com/Yukyin/DeepSupport).
|
| 97 |
|
| 98 |
+
---
|
| 99 |
|
| 100 |
+
## Safety and privacy ⚠️
|
| 101 |
|
| 102 |
+
This project is intended for supportive conversation only.
|
| 103 |
+
It does not provide professional advice, diagnosis, or therapy. Please seek qualified professional help when needed.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 104 |
|
| 105 |
+
---
|
| 106 |
|
| 107 |
+
## License 📜
|
| 108 |
|
| 109 |
+
This adapter is released for noncommercial use. See the [GitHub repo](https://github.com/Yukyin/DeepSupport) for the full license text and commercial licensing terms.
|
| 110 |
+
|
| 111 |
+
---
|
| 112 |
+
|
| 113 |
+
## Citation 📚
|
| 114 |
|
|
|
|
|
|
|
| 115 |
```bibtex
|
| 116 |
+
@software{deepsupport_warm_2026,
|
| 117 |
+
author = {Yuyan Chen},
|
| 118 |
+
title = {DeepSupport Warm: An emotional-holding companion for supportive dialogue},
|
| 119 |
+
year = {2026},
|
| 120 |
+
version = {oss},
|
| 121 |
+
url = {\url{https://github.com/Yukyin/DeepSupport/DeepSupport_Warm}}
|
|
|
|
| 122 |
}
|
| 123 |
+
```
|
| 124 |
+
|
| 125 |
+
---
|
| 126 |
+
|
| 127 |
+
## Links
|
| 128 |
+
|
| 129 |
+
- GitHub: https://github.com/Yukyin/DeepSupport
|
| 130 |
+
- LoRA adapter: https://huggingface.co/Yukyin/deepsupport-warm-lora-oss
|