Update README.md
Browse files
README.md
CHANGED
@@ -1,204 +0,0 @@
|
|
1 |
-
---
|
2 |
-
library_name: transformers
|
3 |
-
tags: []
|
4 |
-
license: llama3.2
|
5 |
-
---
|
6 |
-
|
7 |
-
|
8 |
-
<a href="https://github.com/MLP-Lab/Bllossom">
|
9 |
-
<img src="https://cdn-uploads.huggingface.co/production/uploads/64a90711c05da19ca834f690/a0VE5UCY1HCEhaHtp3mGa.png" alt="image" width="30%" height="30%">
|
10 |
-
</a>
|
11 |
-
|
12 |
-
# Update!
|
13 |
-
* [2024.12.12] 추가설명: KMMLU, KoBEST, LogicKor 등 벤치 관련 학습/테스트/유사 데이터를 전혀 사용하지 않았습니다. 벤치데이터 증강해가 쓰까서 학습하면 SOTA 성능 근접하게 나옵니다 모델위에 해보세요!
|
14 |
-
* [2024.12.06] Bllossom-AICA-5B 모델 최초 업데이트!
|
15 |
-
|
16 |
-
|
17 |
-
# Bllossom [추론코드예제](https://drive.google.com/file/d/1AoxfoV0TSN-pGdc9fa3dRv3-NLZknHlJ/view?usp=sharing) | [학습코드예제](https://drive.google.com/file/d/1E_fYV-tUhl1LExm2piaIhvXfuOcNaZmP/view?usp=sharing) | [튜토리얼 영상](https://youtu.be/4lAUVwTN608)
|
18 |
-
|
19 |
-
```bash
|
20 |
-
저희 Bllossom 팀에서 llama3.2-3B 기반의 한국어-영어 언어모델 Bllossom-AICA-5B를 공개합니다.
|
21 |
-
이번 Bllossom-AICA는 다음과 같은 특징을 보입니다.
|
22 |
-
- 일반 언어모델, 시각-언어모델 양방향으로 활용이 가능한 최초의 llama기반 3B확장 모델입니다. (코랩 무료 GPU에서 사용가능한 유일한 시각-언어 한국어 )
|
23 |
-
- 이미지를 넣으면 시각-언어모델, 넣지 않으면 언어모델로 작동하며 시각-언어, 그냥 언어모델 양방향모두 학습 및 추론이 가능합니다.
|
24 |
-
- 시각 정보의 이해를 바탕으로 언어모델의 성능이 대폭 향상되었습니다. (정성평가 기준 Bllossom-3.2-3B모델 대비 20%이상)
|
25 |
-
- 한국어 OCR, 표, 그래프 해석에 최적화 되어있습니다.
|
26 |
-
- 외부지식에 대한 선택적 추론 기능이 학습되었습니다. RAG를 활용할 때 질문과 관련 없는 오류가 섞인 정보의 경우 모델 스스로 활용하지 않습니다.
|
27 |
-
|
28 |
-
해당 모델에 활용된 데이터는 다음과 같습니다.
|
29 |
-
- Huggingface에 공개된 한국어 LLM 사전학습 데이터를 거의 모두 활용해 Full tuning 했습니다.
|
30 |
-
- AI-Hub, KISTI AI데이터, Huggingface에 공개된 거의 모든 한국어 시각-언어 관련 학습데이터를 활용해 시각-언어모델 사전학습을 했습니다. (다 나열하기 너무 많아요...)
|
31 |
-
- 저희 연구실에서 자체 제작한 한국어 시각-언어 Instruction Tuning데이터를 활용했습니다.
|
32 |
-
|
33 |
-
언제나 그랬듯 해당 모델은 상업적 이용이 가능합니다.
|
34 |
-
|
35 |
-
1. Bllossom-AICA의 외부지식 지식추론 기능은 COLING2025에 발표될 예정입니다.
|
36 |
-
2. 3B기반 모델이 이정도면 8B기반 모델은 어느정도인지 궁금하지 않으세요? 좋은 언어모델 계속 업데이트 하겠습니다!!
|
37 |
-
```
|
38 |
-
|
39 |
-
```bash
|
40 |
-
We, the Bllossom team, are pleased to announce the release of Bllossom-Vision, a Korean-English vision-language model based on llama3.2. This Bllossom-Vision is a preview version and features the following:
|
41 |
-
- It can be utilized both as a general language model and as a vision-language model.
|
42 |
-
- It operates as a vision-language model when an image is provided, and as a language model when no image is provided. It is capable of both training and inference in both directions, whether as a vision-language or just a language model.
|
43 |
-
- We have put significant effort into ensuring it remains faithful to the role of a vision-language model while maintaining the performance of a traditional language model as much as possible.
|
44 |
-
- It is a fully bilingual model that does not compromise English performance at all.
|
45 |
-
```
|
46 |
-
**Bllossom is 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)**
|
47 |
-
|
48 |
-
|
49 |
-
## Demo Video
|
50 |
-
|
51 |
-
<div style="display: flex; justify-content: space-between;">
|
52 |
-
<!-- 두 번째 컬럼 -->
|
53 |
-
<div style="width: 100%;">
|
54 |
-
<a>
|
55 |
-
<img src="https://cdn-uploads.huggingface.co/production/uploads/64a90711c05da19ca834f690/BJu5VT_llvYkWk_mkF4x6.gif" style="width: 100%; height: auto;">
|
56 |
-
</a>
|
57 |
-
<p style="text-align: center;">Bllossom-AIC Demo</p>
|
58 |
-
</div>
|
59 |
-
</div>
|
60 |
-
|
61 |
-
|
62 |
-
## LogicKor Score
|
63 |
-
| Category | Single turn | Multi turn |
|
64 |
-
|---|---|---|
|
65 |
-
| 추론(Reasoning) | 6.57 | 5.29 |
|
66 |
-
| 수학(Math) | 6.43 | 6.29 |
|
67 |
-
| 글쓰기(Writing) | 9.14 | 8.71 |
|
68 |
-
| 코딩(Coding) | 8.00 | 9.14 |
|
69 |
-
| 이해(Understanding) | 8.14 | 9.29 |
|
70 |
-
| 문법(Grammar) | 6.71 | 4.86 |
|
71 |
-
|
72 |
-
| Category | Score |
|
73 |
-
|---|---|
|
74 |
-
| Single turn | 7.50 |
|
75 |
-
| Multi turn | 7.26 |
|
76 |
-
| Overall | 7.38 |
|
77 |
-
|
78 |
-
## Example code
|
79 |
-
|
80 |
-
### Python code (Use Vision-language Model)
|
81 |
-
```python
|
82 |
-
from transformers import MllamaForConditionalGeneration,MllamaProcessor
|
83 |
-
import torch
|
84 |
-
from PIL import Image
|
85 |
-
import requests
|
86 |
-
|
87 |
-
model = MllamaForConditionalGeneration.from_pretrained(
|
88 |
-
'Bllossom/llama-3.2-Korean-Bllossom-AICA-5B',
|
89 |
-
torch_dtype=torch.bfloat16,
|
90 |
-
device_map='auto'
|
91 |
-
)
|
92 |
-
processor = MllamaProcessor.from_pretrained('Bllossom/llama-3.2-Korean-Bllossom-AICA-5B')
|
93 |
-
|
94 |
-
url = "https://t1.daumcdn.net/cfile/tistory/21527E4A543DCABE1D"
|
95 |
-
image = Image.open(requests.get(url, stream=True).raw)
|
96 |
-
|
97 |
-
messages = [
|
98 |
-
{'role': 'user','content': [
|
99 |
-
{'type':'image'},
|
100 |
-
{'type': 'text','text': '이 문서를 마크다운으로 바꿔줘'}
|
101 |
-
]},
|
102 |
-
]
|
103 |
-
|
104 |
-
input_text = processor.apply_chat_template(messages,tokenize=False,add_generation_prompt=True)
|
105 |
-
|
106 |
-
inputs = processor(
|
107 |
-
image,
|
108 |
-
input_text,
|
109 |
-
add_special_tokens=False,
|
110 |
-
return_tensors="pt",
|
111 |
-
).to(model.device)
|
112 |
-
|
113 |
-
output = model.generate(**inputs, max_new_tokens=256,temperature=0.1,eos_token_id=processor.tokenizer.convert_tokens_to_ids('<|eot_id|>'),use_cache=False)
|
114 |
-
print(processor.decode(output[0]))
|
115 |
-
```
|
116 |
-
|
117 |
-
### Python code (Use Language Model)
|
118 |
-
```python
|
119 |
-
from transformers import MllamaForConditionalGeneration,MllamaProcessor
|
120 |
-
import torch
|
121 |
-
from PIL import Image
|
122 |
-
import requests
|
123 |
-
|
124 |
-
model = MllamaForConditionalGeneration.from_pretrained(
|
125 |
-
'Bllossom/llama-3.2-Korean-Bllossom-AICA-5B',
|
126 |
-
torch_dtype=torch.bfloat16,
|
127 |
-
device_map='auto'
|
128 |
-
)
|
129 |
-
processor = MllamaProcessor.from_pretrained('Bllossom/llama-3.2-Korean-Bllossom-AICA-5B')
|
130 |
-
|
131 |
-
url = "https://cdn.discordapp.com/attachments/1156141391798345742/1313407928287494164/E18489E185B3E1848FE185B3E18485E185B5E186ABE18489E185A3E186BA202021-11-1620E1848BE185A9E18492E185AE2011.png?ex=675005f4&is=674eb474&hm=fc9c4231203f53c27f6edd2420961c182dd4a1ed14d4b73e04127f11393729af&"
|
132 |
-
image = Image.open(requests.get(url, stream=True).raw)
|
133 |
-
|
134 |
-
messages = [
|
135 |
-
{'role': 'user','content': [
|
136 |
-
{'type': 'text','text': '자연어처리 15주치 커리큘럼을 짜줘'}
|
137 |
-
]},
|
138 |
-
]
|
139 |
-
|
140 |
-
input_text = processor.apply_chat_template(messages,tokenize=False,add_generation_prompt=True)
|
141 |
-
|
142 |
-
inputs = processor(
|
143 |
-
images=None,
|
144 |
-
text=input_text,
|
145 |
-
add_special_tokens=False,
|
146 |
-
return_tensors="pt",
|
147 |
-
).to(model.device)
|
148 |
-
|
149 |
-
output = model.generate(**inputs,max_new_tokens=256,temperature=0.1,eos_token_id=processor.tokenizer.convert_tokens_to_ids('<|eot_id|>'),use_cache=False)
|
150 |
-
print(processor.decode(output[0]))
|
151 |
-
```
|
152 |
-
|
153 |
-
|
154 |
-
## Supported by
|
155 |
-
|
156 |
-
- AICA <img src="https://aica-gj.kr/images/logo.png" width="20%" height="20%">
|
157 |
-
|
158 |
-
## Citation
|
159 |
-
|
160 |
-
**Vision-Language Model**
|
161 |
-
```text
|
162 |
-
@misc{VLR-Bench,
|
163 |
-
author = {Hyeonseok Lim, Dongjae Shin, Seohyun Song, Inho Won, Minjun Kim, Junghun Yuk, Hangyeol Yoo, Haneol Jang, Kyungtae Lim},
|
164 |
-
title = {VLR-Bench: Multilingual Benchmark Dataset for Vision-Language Retrieval Augmented Generation},
|
165 |
-
year = {2025},
|
166 |
-
publisher = {GitHub},
|
167 |
-
journal = {COLING 2025},
|
168 |
-
paperLink = {\url{https://arxiv.org/abs/2412.10151}},
|
169 |
-
},
|
170 |
-
}
|
171 |
-
```
|
172 |
-
|
173 |
-
```text
|
174 |
-
@misc{bllossom-V,
|
175 |
-
author = {Dongjae Shin, Hyeonseok Lim, Inho Won, Changsu Choi, Minjun Kim, Seungwoo Song, Hangyeol Yoo, Sangmin Kim, Kyungtae Lim},
|
176 |
-
title = {X-LLaVA: Optimizing Bilingual Large Vision-Language Alignment},
|
177 |
-
year = {2024},
|
178 |
-
publisher = {GitHub},
|
179 |
-
journal = {NAACL 2024 findings},
|
180 |
-
paperLink = {\url{https://arxiv.org/pdf/2403.11399}},
|
181 |
-
},
|
182 |
-
}
|
183 |
-
```
|
184 |
-
**Language Model**
|
185 |
-
```text
|
186 |
-
@misc{bllossom,
|
187 |
-
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},
|
188 |
-
title = {Optimizing Language Augmentation for Multilingual Large Language Models: A Case Study on Korean},
|
189 |
-
year = {2024},
|
190 |
-
journal = {LREC-COLING 2024},
|
191 |
-
paperLink = {\url{https://arxiv.org/pdf/2403.10882}},
|
192 |
-
},
|
193 |
-
}
|
194 |
-
```
|
195 |
-
|
196 |
-
## Contact
|
197 |
-
- 임경태(KyungTae Lim), Professor at Seoultech. `[email protected]`
|
198 |
-
- 함영균(Younggyun Hahm), CEO of Teddysum. `[email protected]`
|
199 |
-
- 김한샘(Hansaem Kim), Professor at Yonsei. `[email protected]`
|
200 |
-
|
201 |
-
## Contributor
|
202 |
-
- **신동재(Dongjae Shin)**, [email protected]
|
203 |
-
- **유한결(Hangyeol Yoo)**, [email protected]
|
204 |
-
- **임현석(Hyeonseok Lim)**, [email protected]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|