Update README.md
Browse files
README.md
CHANGED
@@ -2,199 +2,136 @@
|
|
2 |
library_name: transformers
|
3 |
tags:
|
4 |
- unsloth
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
---
|
6 |
|
7 |
-
#
|
8 |
-
|
9 |
-
<!-- Provide a quick summary of what the model is/does. -->
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
## Model Details
|
14 |
|
15 |
### Model Description
|
16 |
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
- **
|
22 |
-
- **Funded by [optional]:** [More Information Needed]
|
23 |
-
- **Shared by [optional]:** [More Information Needed]
|
24 |
-
- **Model type:** [More Information Needed]
|
25 |
-
- **Language(s) (NLP):** [More Information Needed]
|
26 |
-
- **License:** [More Information Needed]
|
27 |
-
- **Finetuned from model [optional]:** [More Information Needed]
|
28 |
-
|
29 |
-
### Model Sources [optional]
|
30 |
-
|
31 |
-
<!-- Provide the basic links for the model. -->
|
32 |
-
|
33 |
-
- **Repository:** [More Information Needed]
|
34 |
-
- **Paper [optional]:** [More Information Needed]
|
35 |
-
- **Demo [optional]:** [More Information Needed]
|
36 |
-
|
37 |
-
## Uses
|
38 |
-
|
39 |
-
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
|
40 |
-
|
41 |
-
### Direct Use
|
42 |
-
|
43 |
-
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
|
44 |
-
|
45 |
-
[More Information Needed]
|
46 |
-
|
47 |
-
### Downstream Use [optional]
|
48 |
-
|
49 |
-
<!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
|
50 |
-
|
51 |
-
[More Information Needed]
|
52 |
-
|
53 |
-
### Out-of-Scope Use
|
54 |
-
|
55 |
-
<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
|
56 |
-
|
57 |
-
[More Information Needed]
|
58 |
-
|
59 |
-
## Bias, Risks, and Limitations
|
60 |
-
|
61 |
-
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
|
62 |
-
|
63 |
-
[More Information Needed]
|
64 |
-
|
65 |
-
### Recommendations
|
66 |
-
|
67 |
-
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
|
68 |
-
|
69 |
-
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
|
70 |
-
|
71 |
-
## How to Get Started with the Model
|
72 |
-
|
73 |
-
Use the code below to get started with the model.
|
74 |
-
|
75 |
-
[More Information Needed]
|
76 |
-
|
77 |
-
## Training Details
|
78 |
-
|
79 |
-
### Training Data
|
80 |
-
|
81 |
-
<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
|
82 |
-
|
83 |
-
[More Information Needed]
|
84 |
-
|
85 |
-
### Training Procedure
|
86 |
-
|
87 |
-
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
88 |
-
|
89 |
-
#### Preprocessing [optional]
|
90 |
-
|
91 |
-
[More Information Needed]
|
92 |
-
|
93 |
-
|
94 |
-
#### Training Hyperparameters
|
95 |
-
|
96 |
-
- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
|
97 |
-
|
98 |
-
#### Speeds, Sizes, Times [optional]
|
99 |
-
|
100 |
-
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
|
101 |
-
|
102 |
-
[More Information Needed]
|
103 |
-
|
104 |
-
## Evaluation
|
105 |
-
|
106 |
-
<!-- This section describes the evaluation protocols and provides the results. -->
|
107 |
-
|
108 |
-
### Testing Data, Factors & Metrics
|
109 |
-
|
110 |
-
#### Testing Data
|
111 |
-
|
112 |
-
<!-- This should link to a Dataset Card if possible. -->
|
113 |
-
|
114 |
-
[More Information Needed]
|
115 |
-
|
116 |
-
#### Factors
|
117 |
-
|
118 |
-
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
119 |
-
|
120 |
-
[More Information Needed]
|
121 |
-
|
122 |
-
#### Metrics
|
123 |
-
|
124 |
-
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
125 |
-
|
126 |
-
[More Information Needed]
|
127 |
-
|
128 |
-
### Results
|
129 |
|
130 |
-
|
131 |
|
132 |
-
|
|
|
133 |
|
|
|
134 |
|
|
|
|
|
|
|
135 |
|
136 |
-
|
137 |
|
138 |
-
|
|
|
|
|
139 |
|
140 |
-
[More Information Needed]
|
141 |
|
142 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
143 |
|
144 |
-
|
145 |
|
146 |
-
|
|
|
147 |
|
148 |
-
|
149 |
-
|
150 |
-
- **Cloud Provider:** [More Information Needed]
|
151 |
-
- **Compute Region:** [More Information Needed]
|
152 |
-
- **Carbon Emitted:** [More Information Needed]
|
153 |
|
154 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
155 |
|
156 |
-
|
|
|
|
|
157 |
|
158 |
-
|
159 |
|
160 |
-
|
161 |
|
162 |
-
|
|
|
|
|
163 |
|
164 |
-
|
|
|
165 |
|
166 |
-
|
|
|
167 |
|
168 |
-
|
|
|
|
|
169 |
|
170 |
-
|
171 |
|
172 |
-
|
|
|
|
|
173 |
|
174 |
-
|
175 |
|
176 |
-
|
|
|
|
|
177 |
|
178 |
-
|
|
|
179 |
|
180 |
-
|
|
|
|
|
181 |
|
182 |
-
|
183 |
|
184 |
-
|
185 |
|
186 |
-
|
|
|
187 |
|
188 |
-
|
|
|
189 |
|
190 |
-
|
191 |
|
192 |
-
|
|
|
|
|
193 |
|
194 |
-
|
|
|
195 |
|
196 |
-
|
|
|
197 |
|
198 |
-
|
|
|
199 |
|
200 |
-
|
|
|
|
2 |
library_name: transformers
|
3 |
tags:
|
4 |
- unsloth
|
5 |
+
- KoAlpaca
|
6 |
+
- Solar-Ko
|
7 |
+
license: apache-2.0
|
8 |
+
datasets:
|
9 |
+
- beomi/KoAlpaca-RealQA
|
10 |
+
language:
|
11 |
+
- ko
|
12 |
+
base_model:
|
13 |
+
- beomi/Solar-Ko-Recovery-11B
|
14 |
+
pipeline_tag: text-generation
|
15 |
---
|
16 |
|
17 |
+
# KoAlpaca-RealQA-Solar-Ko-Recovery-11B (QLoRA with Unsloth)
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
|
19 |
### Model Description
|
20 |
|
21 |
+
- **Developed by:** Lee Junbum (Beomi)
|
22 |
+
- **Model type:** Instruction Tuned, with beomi/KoAlpaca-RealQA dataset
|
23 |
+
- **Language(s) (NLP):** Korean Mainly, partially English
|
24 |
+
- **License:** Apache 2.0
|
25 |
+
- **Finetuned from model:** beomi/Solar-Ko-Recovery-11B
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
|
27 |
+
### Model Sources
|
28 |
|
29 |
+
- **Training Code (Google Colab, Pro+ A100 40G):** https://colab.research.google.com/drive/11Ni8rOBmV1Qh15i7gMWncKjYBEdrJLBt
|
30 |
+
- **Inference Code (Google Colab):** https://colab.research.google.com/drive/1hEPSHI4aGOn29Y21c6SWJc-y2ECVx3Bz?usp=sharing
|
31 |
|
32 |
+
### Direct Use with Unsloth
|
33 |
|
34 |
+
```python
|
35 |
+
# pip install -U hf_transfer unsloth
|
36 |
+
import os
|
37 |
|
38 |
+
os.environ["HF_HUB_ENABLE_HF_TRANSFER"] = "1" # download speed upto 1000MB/s
|
39 |
|
40 |
+
import torch
|
41 |
+
from unsloth import FastLanguageModel
|
42 |
+
from transformers import TextStreamer
|
43 |
|
|
|
44 |
|
45 |
+
model, tokenizer = FastLanguageModel.from_pretrained(
|
46 |
+
model_name = "beomi/KoAlpaca-RealQA-Solar-Ko-Recovery-11B", # YOUR MODEL YOU USED FOR TRAINING
|
47 |
+
max_seq_length = 2048,
|
48 |
+
dtype = torch.bfloat16,
|
49 |
+
load_in_4bit = True,
|
50 |
+
)
|
51 |
+
FastLanguageModel.for_inference(model) # Enable native 2x faster inference
|
52 |
|
53 |
+
alpaca_prompt = """Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
|
54 |
|
55 |
+
### Instruction:
|
56 |
+
{}
|
57 |
|
58 |
+
### Response:
|
59 |
+
{}"""
|
|
|
|
|
|
|
60 |
|
61 |
+
def gen(x):
|
62 |
+
inputs = tokenizer(
|
63 |
+
[
|
64 |
+
alpaca_prompt.format(
|
65 |
+
x.strip(), # instruction
|
66 |
+
"", # output - leave this blank for generation!
|
67 |
+
)
|
68 |
+
], return_tensors = "pt").to("cuda")
|
69 |
|
70 |
+
text_streamer = TextStreamer(tokenizer)
|
71 |
+
_ = model.generate(**inputs, streamer = text_streamer, max_new_tokens = 512)
|
72 |
+
```
|
73 |
|
74 |
+
### Generation Example
|
75 |
|
76 |
+
**Sample 01**
|
77 |
|
78 |
+
```
|
79 |
+
gen("μλ
νμΈμ")
|
80 |
+
```
|
81 |
|
82 |
+
```
|
83 |
+
<s> Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
|
84 |
|
85 |
+
### Instruction:
|
86 |
+
μλ
νμΈμ
|
87 |
|
88 |
+
### Response:
|
89 |
+
μλ
νμΈμ! μ΄λ»κ² λμλ릴κΉμ?</s>
|
90 |
+
```
|
91 |
|
92 |
+
**Sample 02**
|
93 |
|
94 |
+
```
|
95 |
+
gen("""μλ κΈμ νκ΅μ΄λ‘ λ²μν΄μ€.
|
96 |
+
Dataset Summary
|
97 |
|
98 |
+
The KoAlpaca-RealQA dataset is a unique Korean instruction dataset designed to closely reflect real user interactions in the Korean language. Unlike conventional Korean instruction datasets that rely heavily on translated prompts, this dataset is composed of authentic Korean instructions derived from real-world use cases. Specifically, the dataset has been curated from user interactions with the ChatKoAlpaca service, which is based on the KoAlpaca model trained between 2023 and 2024.
|
99 |
|
100 |
+
This dataset provides a more accurate portrayal of typical Korean user behaviors, questions, and language structures, making it highly relevant for developing language models aimed at understanding and responding to Korean speakers. By leveraging GPT4o to generate high-quality answers, KoAlpaca-RealQA aims to offer a robust resource for training models that need to engage with Korean users in a natural and meaningful way.
|
101 |
+
""")
|
102 |
+
```
|
103 |
|
104 |
+
```
|
105 |
+
<s> Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
|
106 |
|
107 |
+
### Instruction:
|
108 |
+
μλ κΈμ νκ΅μ΄λ‘ λ²μν΄μ€.
|
109 |
+
Dataset Summary
|
110 |
|
111 |
+
The KoAlpaca-RealQA dataset is a unique Korean instruction dataset designed to closely reflect real user interactions in the Korean language. Unlike conventional Korean instruction datasets that rely heavily on translated prompts, this dataset is composed of authentic Korean instructions derived from real-world use cases. Specifically, the dataset has been curated from user interactions with the ChatKoAlpaca service, which is based on the KoAlpaca model trained between 2023 and 2024.
|
112 |
|
113 |
+
This dataset provides a more accurate portrayal of typical Korean user behaviors, questions, and language structures, making it highly relevant for developing language models aimed at understanding and responding to Korean speakers. By leveraging GPT4o to generate high-quality answers, KoAlpaca-RealQA aims to offer a robust resource for training models that need to engage with Korean users in a natural and meaningful way.
|
114 |
|
115 |
+
### Response:
|
116 |
+
KoAlpaca-RealQA λ°μ΄ν°μ
μ νκ΅μ΄ μ¬μ©μλ€μ μ€μ μνΈμμ©μ λ§€μ° μ λ°μνλλ‘ μ€κ³λ λ
νΉν νκ΅μ΄ μ§μ λ°μ΄ν°μ
μ
λλ€. λ²μλ ν둬ννΈμ ν¬κ² μμ‘΄νλ κΈ°μ‘΄μ νκ΅μ΄ μ§μ λ°μ΄ν°μ
κ³Ό λ¬λ¦¬, μ΄ λ°μ΄ν°μ
μ μ€μ μ¬μ© μ¬λ‘μμ μ λλ μ§μ ν νκ΅μ΄ μ§μλ‘ κ΅¬μ±λμ΄ μμ΅λλ€. νΉν, μ΄ λ°μ΄ν°μ
μ 2023λ
κ³Ό 2024λ
μ¬μ΄μ νλ ¨λ KoAlpaca λͺ¨λΈμ κΈ°λ°μΌλ‘ ν ChatKoAlpaca μλΉμ€μμ μ¬μ©μ μνΈμμ©μμ μμ§λμμ΅λλ€.
|
117 |
|
118 |
+
μ΄ λ°μ΄ν°μ
μ μΌλ°μ μΈ νκ΅μ΄ μ¬μ©μμ νλ, μ§λ¬Έ λ° μΈμ΄ ꡬ쑰λ₯Ό λ μ ννκ² λ¬μ¬νμ¬, νκ΅μ΄ μ¬μ©μλ₯Ό μ΄ν΄νκ³ μλ΅νλ μΈμ΄ λͺ¨λΈμ κ°λ°νλ λ° λ§€μ° μ μ©ν©λλ€. GPT4oλ₯Ό νμ©νμ¬ κ³ νμ§μ λ΅λ³μ μμ±ν¨μΌλ‘μ¨, KoAlpaca-RealQAλ μμ°μ€λ½κ³ μλ―Έ μλ λ°©μμΌλ‘ νκ΅μ΄ μ¬μ©μμ μνΈμμ©ν΄μΌ νλ λͺ¨λΈμ νλ ¨μν€κΈ° μν κ°λ ₯ν μμμ λͺ©νλ‘ νκ³ μμ΅λλ€.</s>
|
119 |
+
```
|
120 |
|
121 |
+
**Sample 03**
|
122 |
|
123 |
+
```
|
124 |
+
gen("""KoAlpacaμ λν΄ μ€λͺ
ν΄μ€.""")
|
125 |
+
```
|
126 |
|
127 |
+
```
|
128 |
+
<s> Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
|
129 |
|
130 |
+
### Instruction:
|
131 |
+
KoAlpacaμ λν΄ μ€λͺ
ν΄μ€.
|
132 |
|
133 |
+
### Response:
|
134 |
+
KoAlpacaλ νκ΅μ΄ μμ°μ΄ μ²λ¦¬(NLP) λͺ¨λΈλ‘, OpenAIμ GPT-3μ κ°μ λν μΈμ΄ λͺ¨λΈ(LLM)μ κΈ°λ°μΌλ‘ ν©λλ€. KoAlpacaλ νκ΅μ΄ λ°μ΄ν°λ₯Ό μ£Όλ‘ μ¬μ©νμ¬ νμ΅λμκΈ° λλ¬Έμ νκ΅μ΄ ν
μ€νΈλ₯Ό μ΄ν΄νκ³ μμ±νλ λ° νΉνλμ΄ μμ΅λλ€. μ΄ λͺ¨λΈμ λ€μν νκ΅μ΄ μμ© νλ‘κ·Έλ¨μμ νμ©λ μ μμΌλ©°, μλ₯Ό λ€μ΄ λνν AI, λ²μ, μμ½, μ§λ¬Έ λ΅λ³ λ± μ¬λ¬ λΆμΌμμ μ¬μ©λ μ μμ΅λλ€.
|
135 |
|
136 |
+
KoAlpacaλ νκ΅μ΄ μ¬μ©μμκ² λ³΄λ€ μμ°μ€λ½κ³ μ μ°½ν μΈμ΄ μνΈμμ©μ μ 곡νλ©°, νκ΅μ΄ λ¬Έλ§₯μ μ μ΄ν΄νκ³ μ²λ¦¬ν μ μλλ‘ μ€κ³λμμ΅λλ€. μ΄λ¬ν λͺ¨λΈμ νκ΅μ΄ NLP μ°κ΅¬μ μ°μ
μμ μ€μν λκ΅¬λ‘ μ¬μ©λ μ μμ΅λλ€.</s>
|
137 |
+
```
|