beomi commited on
Commit
7f1b665
β€’
1 Parent(s): 90ab77d

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +93 -156
README.md CHANGED
@@ -2,199 +2,136 @@
2
  library_name: transformers
3
  tags:
4
  - unsloth
 
 
 
 
 
 
 
 
 
 
5
  ---
6
 
7
- # Model Card for Model ID
8
-
9
- <!-- Provide a quick summary of what the model is/does. -->
10
-
11
-
12
-
13
- ## Model Details
14
 
15
  ### Model Description
16
 
17
- <!-- Provide a longer summary of what this model is. -->
18
-
19
- This is the model card of a πŸ€— transformers model that has been pushed on the Hub. This model card has been automatically generated.
20
-
21
- - **Developed by:** [More Information Needed]
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
- [More Information Needed]
131
 
132
- #### Summary
 
133
 
 
134
 
 
 
 
135
 
136
- ## Model Examination [optional]
137
 
138
- <!-- Relevant interpretability work for the model goes here -->
 
 
139
 
140
- [More Information Needed]
141
 
142
- ## Environmental Impact
 
 
 
 
 
 
143
 
144
- <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
145
 
146
- Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
 
147
 
148
- - **Hardware Type:** [More Information Needed]
149
- - **Hours used:** [More Information Needed]
150
- - **Cloud Provider:** [More Information Needed]
151
- - **Compute Region:** [More Information Needed]
152
- - **Carbon Emitted:** [More Information Needed]
153
 
154
- ## Technical Specifications [optional]
 
 
 
 
 
 
 
155
 
156
- ### Model Architecture and Objective
 
 
157
 
158
- [More Information Needed]
159
 
160
- ### Compute Infrastructure
161
 
162
- [More Information Needed]
 
 
163
 
164
- #### Hardware
 
165
 
166
- [More Information Needed]
 
167
 
168
- #### Software
 
 
169
 
170
- [More Information Needed]
171
 
172
- ## Citation [optional]
 
 
173
 
174
- <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
175
 
176
- **BibTeX:**
 
 
177
 
178
- [More Information Needed]
 
179
 
180
- **APA:**
 
 
181
 
182
- [More Information Needed]
183
 
184
- ## Glossary [optional]
185
 
186
- <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
 
187
 
188
- [More Information Needed]
 
189
 
190
- ## More Information [optional]
191
 
192
- [More Information Needed]
 
 
193
 
194
- ## Model Card Authors [optional]
 
195
 
196
- [More Information Needed]
 
197
 
198
- ## Model Card Contact
 
199
 
200
- [More Information Needed]
 
 
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
+ ```