jujbob commited on
Commit
1e8ebc7
β€’
1 Parent(s): 651e341

First Commit Good Luck!

Browse files
Files changed (1) hide show
  1. README.md +229 -195
README.md CHANGED
@@ -1,199 +1,233 @@
1
  ---
 
 
 
 
2
  library_name: transformers
3
- tags: []
 
4
  ---
5
 
6
- # Model Card for Model ID
7
-
8
- <!-- Provide a quick summary of what the model is/does. -->
9
-
10
-
11
-
12
- ## Model Details
13
-
14
- ### Model Description
15
-
16
- <!-- Provide a longer summary of what this model is. -->
17
-
18
- This is the model card of a πŸ€— transformers model that has been pushed on the Hub. This model card has been automatically generated.
19
-
20
- - **Developed by:** [More Information Needed]
21
- - **Funded by [optional]:** [More Information Needed]
22
- - **Shared by [optional]:** [More Information Needed]
23
- - **Model type:** [More Information Needed]
24
- - **Language(s) (NLP):** [More Information Needed]
25
- - **License:** [More Information Needed]
26
- - **Finetuned from model [optional]:** [More Information Needed]
27
-
28
- ### Model Sources [optional]
29
-
30
- <!-- Provide the basic links for the model. -->
31
-
32
- - **Repository:** [More Information Needed]
33
- - **Paper [optional]:** [More Information Needed]
34
- - **Demo [optional]:** [More Information Needed]
35
-
36
- ## Uses
37
-
38
- <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
39
-
40
- ### Direct Use
41
-
42
- <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
43
-
44
- [More Information Needed]
45
-
46
- ### Downstream Use [optional]
47
-
48
- <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
49
-
50
- [More Information Needed]
51
-
52
- ### Out-of-Scope Use
53
-
54
- <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
55
-
56
- [More Information Needed]
57
-
58
- ## Bias, Risks, and Limitations
59
-
60
- <!-- This section is meant to convey both technical and sociotechnical limitations. -->
61
-
62
- [More Information Needed]
63
-
64
- ### Recommendations
65
-
66
- <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
67
-
68
- Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
69
-
70
- ## How to Get Started with the Model
71
-
72
- Use the code below to get started with the model.
73
-
74
- [More Information Needed]
75
-
76
- ## Training Details
77
-
78
- ### Training Data
79
-
80
- <!-- 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. -->
81
-
82
- [More Information Needed]
83
-
84
- ### Training Procedure
85
-
86
- <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
87
-
88
- #### Preprocessing [optional]
89
-
90
- [More Information Needed]
91
-
92
-
93
- #### Training Hyperparameters
94
-
95
- - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
96
-
97
- #### Speeds, Sizes, Times [optional]
98
-
99
- <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
100
-
101
- [More Information Needed]
102
-
103
- ## Evaluation
104
-
105
- <!-- This section describes the evaluation protocols and provides the results. -->
106
-
107
- ### Testing Data, Factors & Metrics
108
-
109
- #### Testing Data
110
-
111
- <!-- This should link to a Dataset Card if possible. -->
112
-
113
- [More Information Needed]
114
-
115
- #### Factors
116
-
117
- <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
118
-
119
- [More Information Needed]
120
-
121
- #### Metrics
122
-
123
- <!-- These are the evaluation metrics being used, ideally with a description of why. -->
124
-
125
- [More Information Needed]
126
-
127
- ### Results
128
-
129
- [More Information Needed]
130
-
131
- #### Summary
132
-
133
-
134
-
135
- ## Model Examination [optional]
136
-
137
- <!-- Relevant interpretability work for the model goes here -->
138
-
139
- [More Information Needed]
140
-
141
- ## Environmental Impact
142
-
143
- <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
144
-
145
- 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).
146
-
147
- - **Hardware Type:** [More Information Needed]
148
- - **Hours used:** [More Information Needed]
149
- - **Cloud Provider:** [More Information Needed]
150
- - **Compute Region:** [More Information Needed]
151
- - **Carbon Emitted:** [More Information Needed]
152
-
153
- ## Technical Specifications [optional]
154
-
155
- ### Model Architecture and Objective
156
-
157
- [More Information Needed]
158
-
159
- ### Compute Infrastructure
160
-
161
- [More Information Needed]
162
-
163
- #### Hardware
164
-
165
- [More Information Needed]
166
-
167
- #### Software
168
-
169
- [More Information Needed]
170
-
171
- ## Citation [optional]
172
-
173
- <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
174
-
175
- **BibTeX:**
176
-
177
- [More Information Needed]
178
-
179
- **APA:**
180
-
181
- [More Information Needed]
182
-
183
- ## Glossary [optional]
184
-
185
- <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
186
-
187
- [More Information Needed]
188
-
189
- ## More Information [optional]
190
-
191
- [More Information Needed]
192
-
193
- ## Model Card Authors [optional]
194
-
195
- [More Information Needed]
196
-
197
- ## Model Card Contact
198
-
199
- [More Information Needed]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ language:
3
+ - en
4
+ - ko
5
+ license: llama3
6
  library_name: transformers
7
+ base_model:
8
+ - meta-llama/Meta-Llama-3-70B
9
  ---
10
 
11
+ <a href="https://github.com/MLP-Lab/Bllossom">
12
+ <img src="https://github.com/teddysum/bllossom/blob/main//bllossom_icon.png?raw=true" width="40%" height="50%">
13
+ </a>
14
+
15
+ # Bllossom | [Demo]() | [Homepage](https://www.bllossom.ai/) | [Github](https://github.com/MLP-Lab/Bllossom) | [Colab-tutorial](https://colab.research.google.com/drive/1fBOzUVZ6NRKk_ugeoTbAOokWKqSN47IG?usp=sharing) |
16
+
17
+
18
+ ```bash
19
+ 저희 μ„œμšΈκ³ΌκΈ°λŒ€ MLPμ—°κ΅¬μ‹€μ—μ„œ ν•œκ΅­μ–΄-μ˜μ–΄ 이쀑 μ–Έμ–΄λͺ¨λΈμΈ Bllossom-70.8Bλ₯Ό κ³΅κ°œν–ˆμŠ΅λ‹ˆλ‹€!
20
+ μ„œμšΈκ³ΌκΈ°λŒ€ μŠˆνΌμ»΄ν“¨νŒ… μ„Όν„°μ˜ μ§€μ›μœΌλ‘œ 100GBκ°€λ„˜λŠ” ν•œκ΅­μ–΄λ‘œ λͺ¨λΈμ „체λ₯Ό ν’€νŠœλ‹ν•œ ν•œκ΅­μ–΄ κ°•ν™” 이쀑언어 λͺ¨λΈμž…λ‹ˆλ‹€!
21
+ ν•œκ΅­μ–΄ μž˜ν•˜λŠ” λͺ¨λΈ μ°Ύκ³  μžˆμ§€ μ•ŠμœΌμ…¨λ‚˜μš”?
22
+ - ν•œκ΅­μ–΄ 졜초! 무렀 3λ§Œκ°œκ°€ λ„˜λŠ” ν•œκ΅­μ–΄ μ–΄νœ˜ν™•μž₯
23
+ - Llama3λŒ€λΉ„ λŒ€λž΅ 25% 더 κΈ΄ 길이의 ν•œκ΅­μ–΄ Context μ²˜λ¦¬κ°€λŠ₯
24
+ - ν•œκ΅­μ–΄-μ˜μ–΄ Pararell Corpusλ₯Ό ν™œμš©ν•œ ν•œκ΅­μ–΄-μ˜μ–΄ 지식연결 (μ‚¬μ „ν•™μŠ΅)
25
+ - ν•œκ΅­μ–΄ λ¬Έν™”, μ–Έμ–΄λ₯Ό κ³ λ €ν•΄ μ–Έμ–΄ν•™μžκ°€ μ œμž‘ν•œ 데이터λ₯Ό ν™œμš©ν•œ λ―Έμ„Έμ‘°μ •
26
+ - κ°•ν™”ν•™μŠ΅
27
+ 이 λͺ¨λ“ κ²Œ ν•œκΊΌλ²ˆμ— 적용되고 상업적 이용이 κ°€λŠ₯ν•œ Bllossom을 μ΄μš©ν•΄ μ—¬λŸ¬λΆ„ 만의 λͺ¨λΈμ„ λ§Œλ“€μ–΄λ³΄μ„Έμš₯!
28
+ GPUκ°€ λΆ€μ‘±ν•˜λ©΄ μ–‘μžν™” λͺ¨λΈλ‘œ λ°”λ‘œ μ„œλΉ„μŠ€λ₯Ό ν™œμš©ν•΄ λ³΄μ„Έμš” [μ–‘μžν™”λͺ¨λΈ](https://huggingface.co/Bllossom/llama-3-Korean-Bllossom-70B-gguf-Q4_K_M)!!
29
+
30
+ 1. Bllossom-70.8BλŠ” μ„œμšΈκ³ΌκΈ°λŒ€, ν…Œλ””μΈ, μ—°μ„ΈλŒ€ μ–Έμ–΄μžμ› μ—°κ΅¬μ‹€μ˜ μ–Έμ–΄ν•™μžμ™€ ν˜‘μ—…ν•΄ λ§Œλ“  μ‹€μš©μ£Όμ˜κΈ°λ°˜ μ–Έμ–΄λͺ¨λΈμž…λ‹ˆλ‹€! μ•žμœΌλ‘œ 지속적인 μ—…λ°μ΄νŠΈλ₯Ό 톡해 κ΄€λ¦¬ν•˜κ² μŠ΅λ‹ˆλ‹€ 많이 ν™œμš©ν•΄μ£Όμ„Έμš” πŸ™‚
31
+ 2. 초 κ°•λ ₯ν•œ Advanced-Bllossom 8B, 70Bλͺ¨λΈ, μ‹œκ°-μ–Έμ–΄λͺ¨λΈμ„ λ³΄μœ ν•˜κ³  μžˆμŠ΅λ‹ˆλ‹€! (κΆκΈˆν•˜μ‹ λΆ„μ€ κ°œλ³„ μ—°λ½μ£Όμ„Έμš”!!)
32
+ 3. Bllossom은 NAACL2024, LREC-COLING2024 (ꡬ두) λ°œν‘œλ‘œ μ±„νƒλ˜μ—ˆμŠ΅λ‹ˆλ‹€.
33
+ 4. 쒋은 μ–Έμ–΄λͺ¨λΈ 계속 μ—…λ°μ΄νŠΈ ν•˜κ² μŠ΅λ‹ˆλ‹€!! ν•œκ΅­μ–΄ κ°•ν™”λ₯Όμœ„ν•΄ 곡동 μ—°κ΅¬ν•˜μ‹€λΆ„(νŠΉνžˆλ…Όλ¬Έ) μ–Έμ œλ“  ν™˜μ˜ν•©λ‹ˆλ‹€!!
34
+ 특히 μ†ŒλŸ‰μ˜ GPU라도 λŒ€μ—¬ κ°€λŠ₯ν•œνŒ€μ€ μ–Έμ œλ“  μ—°λ½μ£Όμ„Έμš”! λ§Œλ“€κ³  싢은거 λ„μ™€λ“œλ €μš”.
35
+ ```
36
+
37
+ The Bllossom language model is a Korean-English bilingual language model based on the open-source LLama3. It enhances the connection of knowledge between Korean and English. It has the following features:
38
+
39
+ * **Knowledge Linking**: Linking Korean and English knowledge through additional training
40
+ * **Vocabulary Expansion**: Expansion of Korean vocabulary to enhance Korean expressiveness.
41
+ * **Instruction Tuning**: Tuning using custom-made instruction following data specialized for Korean language and Korean culture
42
+ * **Human Feedback**: DPO has been applied
43
+ * **Vision-Language Alignment**: Aligning the vision transformer with this language model
44
+
45
+ **This model developed by [MLPLab at Seoultech](http://mlp.seoultech.ac.kr), [Teddysum](http://teddysum.ai/) and [Yonsei Univ](https://sites.google.com/view/hansaemkim/hansaem-kim)**
46
+
47
+ ## Demo Video
48
+
49
+ <div style="display: flex; justify-content: space-between;">
50
+ <!-- 첫 번째 컬럼 -->
51
+ <div style="width: 49%;">
52
+ <a>
53
+ <img src="https://github.com/lhsstn/lhsstn/blob/main/x-llava_dem.gif?raw=true" style="width: 100%; height: auto;">
54
+ </a>
55
+ <p style="text-align: center;">Bllossom-V Demo</p>
56
+ </div>
57
+
58
+ <!-- 두 번째 컬럼 (ν•„μš”ν•˜λ‹€λ©΄) -->
59
+ <div style="width: 49%;">
60
+ <a>
61
+ <img src="https://github.com/lhsstn/lhsstn/blob/main/bllossom_demo_kakao.gif?raw=true" style="width: 70%; height: auto;">
62
+ </a>
63
+ <p style="text-align: center;">Bllossom Demo(Kakao)γ…€γ…€γ…€γ…€γ…€γ…€γ…€γ…€</p>
64
+ </div>
65
+ </div>
66
+
67
+
68
+
69
+ ## NEWS
70
+ * [2024.05.08] Vocab Expansion Model Update
71
+ * [2024.04.25] We released Bllossom v2.0, based on llama-3
72
+ * [2023/12] We released Bllossom-Vision v1.0, based on Bllossom
73
+ * [2023/08] We released Bllossom v1.0, based on llama-2.
74
+ * [2023/07] We released Bllossom v0.7, based on polyglot-ko.
75
+
76
+
77
+ ## Example code
78
+
79
+ ### Colab Tutorial
80
+ - [Inference-Code-Link](https://colab.research.google.com/drive/1fBOzUVZ6NRKk_ugeoTbAOokWKqSN47IG?usp=sharing)
81
+
82
+ ### Install Dependencies
83
+ ```bash
84
+ pip install torch transformers==4.40.0 accelerate
85
+ ```
86
+
87
+ ### Python code with Pipeline
88
+ ```python
89
+ import transformers
90
+ import torch
91
+
92
+ model_id = "MLP-KTLim/llama-3-Korean-Bllossom-8B"
93
+
94
+ pipeline = transformers.pipeline(
95
+ "text-generation",
96
+ model=model_id,
97
+ model_kwargs={"torch_dtype": torch.bfloat16},
98
+ device_map="auto",
99
+ )
100
+
101
+ pipeline.model.eval()
102
+
103
+ PROMPT = '''당신은 μœ μš©ν•œ AI μ–΄μ‹œμŠ€ν„΄νŠΈμž…λ‹ˆλ‹€. μ‚¬μš©μžμ˜ μ§ˆμ˜μ— λŒ€ν•΄ μΉœμ ˆν•˜κ³  μ •ν™•ν•˜κ²Œ λ‹΅λ³€ν•΄μ•Ό ν•©λ‹ˆλ‹€.
104
+ You are a helpful AI assistant, you'll need to answer users' queries in a friendly and accurate manner.'''
105
+ instruction = "μ„œμšΈκ³Όν•™κΈ°μˆ λŒ€ν•™κ΅ MLP연ꡬ싀에 λŒ€ν•΄ μ†Œκ°œν•΄μ€˜"
106
+
107
+ messages = [
108
+ {"role": "system", "content": f"{PROMPT}"},
109
+ {"role": "user", "content": f"{instruction}"}
110
+ ]
111
+
112
+ prompt = pipeline.tokenizer.apply_chat_template(
113
+ messages,
114
+ tokenize=False,
115
+ add_generation_prompt=True
116
+ )
117
+
118
+ terminators = [
119
+ pipeline.tokenizer.eos_token_id,
120
+ pipeline.tokenizer.convert_tokens_to_ids("<|eot_id|>")
121
+ ]
122
+
123
+ outputs = pipeline(
124
+ prompt,
125
+ max_new_tokens=2048,
126
+ eos_token_id=terminators,
127
+ do_sample=True,
128
+ temperature=0.6,
129
+ top_p=0.9,
130
+ repetition_penalty = 1.1
131
+ )
132
+
133
+ print(outputs[0]["generated_text"][len(prompt):])
134
+
135
+ # μ„œμšΈκ³Όν•™κΈ°μˆ λŒ€ν•™κ΅ MLP연ꡬ싀은 λ©€ν‹°λͺ¨λ‹¬ μžμ—°μ–΄μ²˜λ¦¬ 연ꡬλ₯Ό ν•˜κ³  μžˆμŠ΅λ‹ˆλ‹€. ꡬ성원은 μž„κ²½νƒœ κ΅μˆ˜μ™€ κΉ€λ―Όμ€€, 김상민, 졜창수, μ›μΈν˜Έ, μœ ν•œκ²°, μž„ν˜„μ„, μ†‘μŠΉμš°, μœ‘μ •ν›ˆ, μ‹ λ™μž¬ 학생이 μžˆμŠ΅λ‹ˆλ‹€.
136
+ ```
137
+
138
+ ### Python code with AutoModel
139
+ ```python
140
+
141
+ import os
142
+ import torch
143
+ from transformers import AutoTokenizer, AutoModelForCausalLM
144
+
145
+ model_id = 'MLP-KTLim/llama-3-Korean-Bllossom-8B'
146
+
147
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
148
+ model = AutoModelForCausalLM.from_pretrained(
149
+ model_id,
150
+ torch_dtype=torch.bfloat16,
151
+ device_map="auto",
152
+ )
153
+
154
+ model.eval()
155
+
156
+ PROMPT = '''당신은 μœ μš©ν•œ AI μ–΄μ‹œμŠ€ν„΄νŠΈμž…λ‹ˆλ‹€. μ‚¬μš©μžμ˜ μ§ˆμ˜μ— λŒ€ν•΄ μΉœμ ˆν•˜κ³  μ •ν™•ν•˜κ²Œ λ‹΅λ³€ν•΄μ•Ό ν•©λ‹ˆλ‹€.
157
+ You are a helpful AI assistant, you'll need to answer users' queries in a friendly and accurate manner.'''
158
+ instruction = "μ„œμšΈκ³Όν•™κΈ°μˆ λŒ€ν•™κ΅ MLP연ꡬ싀에 λŒ€ν•΄ μ†Œκ°œν•΄μ€˜"
159
+
160
+ messages = [
161
+ {"role": "system", "content": f"{PROMPT}"},
162
+ {"role": "user", "content": f"{instruction}"}
163
+ ]
164
+
165
+ input_ids = tokenizer.apply_chat_template(
166
+ messages,
167
+ add_generation_prompt=True,
168
+ return_tensors="pt"
169
+ ).to(model.device)
170
+
171
+ terminators = [
172
+ tokenizer.eos_token_id,
173
+ tokenizer.convert_tokens_to_ids("<|eot_id|>")
174
+ ]
175
+
176
+ outputs = model.generate(
177
+ input_ids,
178
+ max_new_tokens=2048,
179
+ eos_token_id=terminators,
180
+ do_sample=True,
181
+ temperature=0.6,
182
+ top_p=0.9,
183
+ repetition_penalty = 1.1
184
+ )
185
+
186
+ print(tokenizer.decode(outputs[0][input_ids.shape[-1]:], skip_special_tokens=True))
187
+ # μ„œμšΈκ³Όν•™κΈ°μˆ λŒ€ν•™κ΅ MLP연ꡬ싀은 λ©€ν‹°λͺ¨λ‹¬ μžμ—°μ–΄μ²˜λ¦¬ 연ꡬλ₯Ό ν•˜κ³  μžˆμŠ΅λ‹ˆλ‹€. ꡬ성원은 μž„κ²½νƒœ κ΅μˆ˜μ™€ κΉ€λ―Όμ€€, 김상민, 졜창수, μ›μΈν˜Έ, μœ ν•œκ²°, μž„ν˜„μ„, μ†‘μŠΉμš°, μœ‘μ •ν›ˆ, μ‹ λ™μž¬ 학생이 μžˆμŠ΅λ‹ˆλ‹€.
188
+ ```
189
+
190
+
191
+
192
+ ## Citation
193
+ **Language Model**
194
+ ```text
195
+ @misc{bllossom,
196
+ author = {ChangSu Choi, Yongbin Jeong, Seoyoon Park, InHo Won, HyeonSeok Lim, SangMin Kim, Yejee Kang, Chanhyuk Yoon, Jaewan Park, Yiseul Lee, HyeJin Lee, Younggyun Hahm, Hansaem Kim, KyungTae Lim},
197
+ title = {Optimizing Language Augmentation for Multilingual Large Language Models: A Case Study on Korean},
198
+ year = {2024},
199
+ journal = {LREC-COLING 2024},
200
+ paperLink = {\url{https://arxiv.org/pdf/2403.10882}},
201
+ },
202
+ }
203
+ ```
204
+
205
+ **Vision-Language Model**
206
+ ```text
207
+ @misc{bllossom-V,
208
+ author = {Dongjae Shin, Hyunseok Lim, Inho Won, Changsu Choi, Minjun Kim, Seungwoo Song, Hangyeol Yoo, Sangmin Kim, Kyungtae Lim},
209
+ title = {X-LLaVA: Optimizing Bilingual Large Vision-Language Alignment},
210
+ year = {2024},
211
+ publisher = {GitHub},
212
+ journal = {NAACL 2024 findings},
213
+ paperLink = {\url{https://arxiv.org/pdf/2403.11399}},
214
+ },
215
+ }
216
+ ```
217
+
218
+ ## Contact
219
+ - μž„κ²½νƒœ(KyungTae Lim), Professor at Seoultech. `ktlim@seoultech.ac.kr`
220
+ - ν•¨μ˜κ· (Younggyun Hahm), CEO of Teddysum. `hahmyg@teddysum.ai`
221
+ - κΉ€ν•œμƒ˜(Hansaem Kim), Professor at Yonsei. `khss@yonsei.ac.kr`
222
+
223
+ ## Contributor
224
+ - 졜창수(Chansu Choi), choics2623@seoultech.ac.kr
225
+ - 김상민(Sangmin Kim), sangmin9708@naver.com
226
+ - μ›μΈν˜Έ(Inho Won), wih1226@seoultech.ac.kr
227
+ - κΉ€λ―Όμ€€(Minjun Kim), mjkmain@seoultech.ac.kr
228
+ - μ†‘μŠΉμš°(Seungwoo Song), sswoo@seoultech.ac.kr
229
+ - μ‹ λ™μž¬(Dongjae Shin), dylan1998@seoultech.ac.kr
230
+ - μž„ν˜„μ„(Hyeonseok Lim), gustjrantk@seoultech.ac.kr
231
+ - μœ‘μ •ν›ˆ(Jeonghun Yuk), usually670@gmail.com
232
+ - μœ ν•œκ²°(Hangyeol Yoo), 21102372@seoultech.ac.kr
233
+ - μ†‘μ„œν˜„(Seohyun Song), alexalex225225@gmail.com