Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,80 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# 🤗 KoLlama-Empathy 💝
|
2 |
+
|
3 |
+
KoLlama-Empathy는 Llama-3.1-8B를 한국어 공감 대화 데이터셋으로 파인튜닝한 언어 모델입니다. 이 모델은 사용자의 감정을 이해하고 공감하는 대화를 생성하는 것을 목표로 합니다. 💭✨
|
4 |
+
|
5 |
+
## 📋 Model Description
|
6 |
+
|
7 |
+
- 🦙 Base Model: unsloth/Meta-Llama-3.1-8B
|
8 |
+
- 📚 Dataset: [AI Hub 감성대화 말뭉치](https://www.aihub.or.kr/aihubdata/data/view.do?dataSetSn=71305)
|
9 |
+
- 🔧 Training Method: LoRA (r=16, alpha=16)
|
10 |
+
|
11 |
+
## ⚙️ Training Configuration
|
12 |
+
|
13 |
+
- 📏 Max Sequence Length: 2048
|
14 |
+
- 📦 Batch Size: 128
|
15 |
+
- 🔄 Gradient Accumulation Steps: 4
|
16 |
+
- 📈 Learning Rate: 2e-4
|
17 |
+
- 🛠️ Optimizer: AdamW 8bit
|
18 |
+
- 💾 Quantization: GGUF q8_0
|
19 |
+
- 🔁 Training Epochs: 3
|
20 |
+
|
21 |
+
TIP: 데이터의 크기나 Epoch을 늘리면 좀 더 좋은 결과를 가져올 수 있을거에요!
|
22 |
+
|
23 |
+
## 💻 Usage
|
24 |
+
|
25 |
+
모델을 사용하는 방법은 다음과 같습니다:
|
26 |
+
|
27 |
+
```python
|
28 |
+
from unsloth import FastLanguageModel
|
29 |
+
|
30 |
+
model, tokenizer = FastLanguageModel.from_pretrained("byeolki/KoLlama-Empathy", load_in_4bit=True)
|
31 |
+
|
32 |
+
alpaca_prompt = """아래는 작업을 설명하는 지시사항입니다. 입력된 내용을 바탕으로 적절한 응답을 작성하세요.
|
33 |
+
### 지시사항:
|
34 |
+
입력에 대해서 공감해주세요.
|
35 |
+
### 입력:
|
36 |
+
{input}
|
37 |
+
### 응답:
|
38 |
+
"""
|
39 |
+
|
40 |
+
FastLanguageModel.for_inference(model)
|
41 |
+
input_text = "안녕하세요. 저 오늘 기분이 안 좋아요."
|
42 |
+
|
43 |
+
inputs = tokenizer([alpaca_prompt.format(input=input_text)], return_tensors="pt").to("cuda")
|
44 |
+
outputs = model.generate(**inputs, max_new_tokens=64, use_cache=True)
|
45 |
+
|
46 |
+
generated_text = tokenizer.batch_decode(outputs, skip_special_tokens=True)[0]
|
47 |
+
print(generated_text)
|
48 |
+
```
|
49 |
+
|
50 |
+
## 💬 Example Conversations
|
51 |
+
|
52 |
+
👤 User: 나 오늘 속상한 일이 있었어.
|
53 |
+
🤖 Assistant: 무슨 일인데 그래? 기분이 많이 안 좋았나 보네.
|
54 |
+
|
55 |
+
👤 User: 나 살이 너무 많이 찐거 같아.
|
56 |
+
🤖 Assistant: 네가 살이 많이 쪠서 그런지 자꾸 스트레스를 받고 있는거 같아.
|
57 |
+
|
58 |
+
## ⚖️ License
|
59 |
+
|
60 |
+
MIT License
|
61 |
+
|
62 |
+
Copyright (c) 2024 byeolki
|
63 |
+
|
64 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
65 |
+
of this software and associated documentation files (the "Software"), to deal
|
66 |
+
in the Software without restriction, including without limitation the rights
|
67 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
68 |
+
copies of the Software, and to permit persons to whom the Software is
|
69 |
+
furnished to do so, subject to the following conditions:
|
70 |
+
|
71 |
+
The above copyright notice and this permission notice shall be included in all
|
72 |
+
copies or substantial portions of the Software.
|
73 |
+
|
74 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
75 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
76 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
77 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
78 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
79 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
80 |
+
SOFTWARE.
|