|
--- |
|
language: |
|
- en |
|
- ko |
|
license: llama3.1 |
|
library_name: transformers |
|
base_model: |
|
- meta-llama/Meta-Llama-3.1-405B |
|
--- |
|
|
|
<a href="https://github.com/MLP-Lab/Bllossom"> |
|
<img src="https://github.com/teddysum/bllossom/blob/main//bllossom_icon.png?raw=true" width="30%" height="30%"> |
|
</a> |
|
|
|
# Update! |
|
* [2024.08.08] preview ๋ชจ๋ธ์ด ์ต์ด ์
๋ฐ์ดํธ ๋์์ต๋๋ค. A100 120๋ ๊ท๋ชจ์ ์ปดํจํ
ํ์๋ก ํ์ต ์งํ์ค์ผ๋ก ๋ชจ๋ธ์ ๊ณ์ ์
๋ฐ์ดํธ๋ ์์ ์
๋๋ค. |
|
|
|
|
|
# Bllossom | [Demo]() | [Homepage](https://www.bllossom.ai/) | [Github](https://github.com/MLP-Lab/Bllossom) | |
|
|
|
<!-- [GPU์ฉ Colab ์ฝ๋์์ ](https://colab.research.google.com/drive/1fBOzUVZ6NRKk_ugeoTbAOokWKqSN47IG?usp=sharing) | --> |
|
<!-- [CPU์ฉ Colab ์์ํ๋ชจ๋ธ ์ฝ๋์์ ](https://colab.research.google.com/drive/129ZNVg5R2NPghUEFHKF0BRdxsZxinQcJ?usp=drive_link) --> |
|
|
|
```bash |
|
์ ํฌ Bllossom ํ์์ llama3.1 ๊ธฐ๋ฐ์ ํ๊ตญ์ด-์์ด ์ด์ค ์ธ์ด๋ชจ๋ธ Bllossom-405B๋ฅผ ๊ณต๊ฐํฉ๋๋ค. |
|
์ด๋ฒ Bllossom3.1-405B๋ preview ๋ฒ์ ์ผ๋ก ๋ค์๊ณผ ๊ฐ์ ํน์ง์ ๋ณด์
๋๋ค. |
|
- Llama3.1-405B-Inst ๋๋น 5~10% ํ๊ตญ์ด ์ฑ๋ฅ์ด ํฅ์ ๋์์ต๋๋ค (single turn ๊ธฐ์ค). |
|
- Llama3.1์ ์์ด ์ฑ๋ฅ์ ์ ํ ์์์ํค์ง ์์ ์์ ํ Bilingual ๋ชจ๋ธ์
๋๋ค. |
|
- ๊ธฐ์กด ๋ชจ๋ธ ๋๋น ์์ฐ์ค๋ฝ๊ณ ์น์ ํ ํ๊ตญ์ด ๋ฌธ์ฅ์ ์์ฑํฉ๋๋ค. |
|
- ์ธ๊ฐํ๊ฐ, GPTํ๊ฐ(MT-Bench, LogicKor 9์ ๋ฑ) ๊ฒฐ๊ณผ GPT4์ ์ ์ฌํ๊ฑฐ๋ ์ฝ๊ฐ ๋ฎ์ ์ฑ๋ฅ์ ๋ณด์ฌ์ค๋๋ค. |
|
|
|
ํด๋น ๋ชจ๋ธ์ ๋ค์๊ณผ ๊ฐ์ ํ์
์ ํ ๋๋ก ๊ตฌ์ถ ๋์์ต๋๋ค! |
|
- ์์ธ๊ณผ๊ธฐ๋ MLP์ฐ๊ตฌ์ค์ ๊ฒฝ๋ํ ์ฌ์ ํ์ต๊ธฐ๋ฒ์ด ์ ์ฉ๋์์ต๋๋ค. |
|
- ํ
๋์ธ์ ์ ๊ตํ Instruction Tuning๊ณผ RAG ๊ธฐ์ ์ด ์ ์ฉ๋์์ต๋๋ค. |
|
- HP์ computing ์ง์์ด ์์์ต๋๋ค. |
|
- Common Crawl ์ฌ๋จ์ Oscarํ์์ ์ ๊ทน์ ์ธ ๋ฐ์ดํฐ ์ง์์ด ์์์ต๋๋ค |
|
|
|
์ธ์ ๋ ๊ทธ๋ฌ๋ฏ ํด๋น ๋ชจ๋ธ์ ์์
์ ์ด์ฉ์ด ๊ฐ๋ฅํฉ๋๋ค. A100 6๋๋ง ์ค๋น๋๋ฉด Bllossom์ ์ด์ฉํด ์ฌ๋ฌ๋ถ๋ง์ ๋ชจ๋ธ์ ๋ง๋ค์ด๋ณด์ธ์ GPT4๊ฐ ๋์ด์ ํ์ ์์ต๋๋ค. |
|
GPU์์์ด ๋ถ์กฑํ๋ฉด A100 3๊ฐ ํน์ A6000 4๊ฐ๋ก ์์ํ ๋ชจ๋ธ์ ์ด์ฉํด ๋ณด์ธ์. [์์ํ๋ชจ๋ธ](https://huggingface.co/MLP-KTLim/llama-3.1-Korean-Bllossom-405B-gguf-Q4_K_M) |
|
|
|
1. Bllossom-8B๋ ์์ธ๊ณผ๊ธฐ๋, ํ
๋์ธ, ์ฐ์ธ๋ ์ธ์ด์์ ์ฐ๊ตฌ์ค์ ์ธ์ดํ์์ ํ์
ํด ๋ง๋ ์ค์ฉ์ฃผ์๊ธฐ๋ฐ ๋ฌด๋ฃ ์ธ์ด๋ชจ๋ธ๋ก 2023๋
๋ถํฐ ์ง์์ ์ธ ์
๋ฐ์ดํธ๋ฅผ ํตํด ๊ด๋ฆฌํด ์ค๊ณ ์์ต๋๋ค. ๋ง์ด ํ์ฉํด์ฃผ์ธ์ ๐ |
|
2. ์ด ๊ฐ๋ ฅํ Advanced-Bllossom ๋ชจ๋ธ, ์๊ฐ-์ธ์ด ๋ชจ๋ธ์ ๋ณด์ ํ๊ณ ์์ต๋๋ค! (๊ถ๊ธํ์ ๋ถ์ ๊ฐ๋ณ ์ฐ๋ฝ์ฃผ์ธ์!!) |
|
3. Bllossom์ NAACL2024, LREC-COLING2024 (๊ตฌ๋) ๋ฐํ๋์์ต๋๋ค. |
|
4. ์ข์ ์ธ์ด๋ชจ๋ธ ๊ณ์ ์
๋ฐ์ดํธ ํ๊ฒ ์ต๋๋ค!! ํ๊ตญ์ด ๊ฐํ๋ฅผ์ํด ๊ณต๋ ์ฐ๊ตฌํ์ค๋ถ(ํนํ๋
ผ๋ฌธ) ์ธ์ ๋ ํ์ํฉ๋๋ค!! |
|
๊ทธ๋ฆฌ๊ณ ์๋์ GPU๋ผ๋ ๋์ฌ ๊ฐ๋ฅํํ์ ์ธ์ ๋ ์ฐ๋ฝ์ฃผ์ธ์! ๋ง๋ค๊ณ ์ถ์๊ฑฐ ๋์๋๋ ค์. |
|
``` |
|
|
|
```bash |
|
The Bllossom language model is a Korean-English bilingual language model based on the open-source LLama3.1. It enhances the connection of knowledge between Korean and English. It has the following features: |
|
- Korean performance improved by 5-10% compared to Llama 3.1-405B-Inst (on Single Turn Eval). |
|
- A complete bilingual model that does not compromise the English performance of Llama 3.1. |
|
- Generates more natural and friendly Korean sentences compared to existing models. |
|
- Human evaluations and GPT evaluations (MT-Bench, LogicKor scoring 9, etc.) show performance similar to or slightly lower than GPT-4. |
|
``` |
|
|
|
**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)** |
|
|
|
## Example code |
|
|
|
### Colab Tutorial |
|
- [Inference-Code-Link](https://colab.research.google.com/drive/1fBOzUVZ6NRKk_ugeoTbAOokWKqSN47IG?usp=sharing) |
|
|
|
### Install Dependencies |
|
```bash |
|
pip install torch transformers==4.40.0 accelerate |
|
``` |
|
|
|
### Python code with Pipeline |
|
```python |
|
import transformers |
|
import torch |
|
|
|
model_id = "Bllossom/llama-3.1-Korean-Bllossom-405B" |
|
|
|
pipeline = transformers.pipeline( |
|
"text-generation", |
|
model=model_id, |
|
model_kwargs={"torch_dtype": torch.bfloat16}, |
|
device_map="auto", |
|
) |
|
|
|
pipeline.model.eval() |
|
|
|
PROMPT = '''You are a helpful AI assistant. Please answer the user's questions kindly. ๋น์ ์ ์ ๋ฅํ AI ์ด์์คํดํธ ์
๋๋ค. ์ฌ์ฉ์์ ์ง๋ฌธ์ ๋ํด ์น์ ํ๊ฒ ๋ต๋ณํด์ฃผ์ธ์.''' |
|
instruction = "์์ธ์ ์ ๋ช
ํ ๊ด๊ด ์ฝ์ค๋ฅผ ๋ง๋ค์ด์ค๋?" |
|
|
|
messages = [ |
|
{"role": "system", "content": f"{PROMPT}"}, |
|
{"role": "user", "content": f"{instruction}"} |
|
] |
|
|
|
prompt = pipeline.tokenizer.apply_chat_template( |
|
messages, |
|
tokenize=False, |
|
add_generation_prompt=True |
|
) |
|
|
|
terminators = [ |
|
pipeline.tokenizer.eos_token_id, |
|
pipeline.tokenizer.convert_tokens_to_ids("<|eot_id|>") |
|
] |
|
|
|
outputs = pipeline( |
|
prompt, |
|
max_new_tokens=2048, |
|
eos_token_id=terminators, |
|
do_sample=True, |
|
temperature=0.6, |
|
top_p=0.9 |
|
) |
|
|
|
print(outputs[0]["generated_text"][len(prompt):]) |
|
``` |
|
``` |
|
# ๋ฌผ๋ก ์ด์ฃ ! ์์ธ์ ๋ค์ํ ๋ฌธํ์ ์ญ์ฌ, ์์ฐ์ ๊ฒธ๋นํ ๋์๋ก, ๋ง์ ๊ด๊ด ๋ช
์๋ฅผ ์๋ํฉ๋๋ค. ์ฌ๊ธฐ ์์ธ์ ์ ๋ช
ํ ๊ด๊ด ์ฝ์ค๋ฅผ ์๊ฐํด ๋๋ฆด๊ฒ์. |
|
|
|
### ์ฝ์ค 1: ์ญ์ฌ์ ๋ฌธํ ํ๋ฐฉ |
|
|
|
1. **๊ฒฝ๋ณต๊ถ** |
|
- ์์ธ์ ๋ํ์ ์ธ ๊ถ๊ถ๋ก, ์กฐ์ ์์กฐ์ ์ญ์ฌ์ ๋ฌธํ๋ฅผ ์ฒดํํ ์ ์๋ ๊ณณ์
๋๋ค. |
|
|
|
2. **๋ถ์ด ํ์ฅ๋ง์** |
|
- ์ ํต ํ์ฅ์ด ์ ๋ณด์กด๋ ๋ง์๋ก, ์กฐ์ ์๋์ ์ํ์์ ๋๋ ์ ์์ต๋๋ค. |
|
|
|
... |
|
``` |
|
|
|
## Supported by |
|
|
|
- Hewlett Packard (HP) Enterprise <img src="https://upload.wikimedia.org/wikipedia/commons/thumb/4/46/Hewlett_Packard_Enterprise_logo.svg/2880px-Hewlett_Packard_Enterprise_logo.svg.png" width="20%" height="20%"> |
|
- Common Crawl <img src="https://cdn.prod.website-files.com/6479b8d98bf5dcb4a69c4f31/649b5869af56f6df617cfb1f_CC_Logo_Blue_Auto.svg" width="20%" height="20%"> |
|
- AICA |
|
|
|
## Citation |
|
**Language Model** |
|
```text |
|
@misc{bllossom, |
|
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}, |
|
title = {Optimizing Language Augmentation for Multilingual Large Language Models: A Case Study on Korean}, |
|
year = {2024}, |
|
journal = {LREC-COLING 2024}, |
|
paperLink = {\url{https://arxiv.org/pdf/2403.10882}}, |
|
}, |
|
} |
|
``` |
|
|
|
**Vision-Language Model** |
|
```text |
|
@misc{bllossom-V, |
|
author = {Dongjae Shin, Hyunseok Lim, Inho Won, Changsu Choi, Minjun Kim, Seungwoo Song, Hangyeol Yoo, Sangmin Kim, Kyungtae Lim}, |
|
title = {X-LLaVA: Optimizing Bilingual Large Vision-Language Alignment}, |
|
year = {2024}, |
|
publisher = {GitHub}, |
|
journal = {NAACL 2024 findings}, |
|
paperLink = {\url{https://arxiv.org/pdf/2403.11399}}, |
|
}, |
|
} |
|
``` |
|
|
|
## Contact |
|
- ์๊ฒฝํ(KyungTae Lim), Professor at Seoultech. `[email protected]` |
|
- ํจ์๊ท (Younggyun Hahm), CEO of Teddysum. `[email protected]` |
|
- ๊นํ์(Hansaem Kim), Professor at Yonsei. `[email protected]` |
|
|
|
## Contributor |
|
- ์ต์ฐฝ์(Chansu Choi), [email protected] |
|
- ๊น์๋ฏผ(Sangmin Kim), [email protected] |
|
- ์์ธํธ(Inho Won), [email protected] |
|
- ๊น๋ฏผ์ค(Minjun Kim), [email protected] |
|
- ์ก์น์ฐ(Seungwoo Song), [email protected] |
|
- ์ ๋์ฌ(Dongjae Shin), [email protected] |
|
- ์ํ์(Hyeonseok Lim), [email protected] |
|
- ์ก์ ํ(Jeonghun Yuk), [email protected] |
|
- ์ ํ๊ฒฐ(Hangyeol Yoo), [email protected] |
|
- ์ก์ํ(Seohyun Song), [email protected] |