metadata
language:
- en
- ko
license: llama3.1
library_name: transformers
base_model:
- meta-llama/Meta-Llama-3.1-8B

Update!
- [2024.09.04] Bllossom의 시각-언어모델 preview 모델이 최초 업데이트 되었습니다.
Bllossom | Demo | Homepage | Github |
저희 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라도 대여 가능한팀은 언제든 연락주세요! 만들고 싶은거 도와드려요.
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, Teddysum and Yonsei Univ
Example code
Colab Tutorial
- Inference-Code-Link (in progress..)
Install Dependencies
pip install torch transformers==4.44.0
Python code with Image
from PIL import Image
from transformers import LlavaNextForConditionalGeneration,LlavaNextProcessor
import torch
model = LlavaNextForConditionalGeneration.from_pretrained('Bllossom/llama-3.1-Korean-Bllossom-Vision-8B', torch_dtype=torch.bfloat16)
processor = LlavaNextProcessor.from_pretrained('Bllossom/llama-3.1-Korean-Bllossom-Vision-8B', torch_dtype=torch.bfloat16)
image = Image.open('[IMAGE_PATH]').convert('RGB')
PROMPT=\
"""You are a versatile AI assistant named Bllava, capable of both understanding and generating text as well as interpreting and analyzing images. Your role is to kindly and effectively answer the user’s questions, whether they are about text or images, and provide appropriate and helpful responses to all types of queries.
당신은 텍스트를 이해하고 생성하는 것뿐만 아니라 이미지를 해석하고 분석할 수 있는 다재다능한 AI 어시스턴트 블라바입니다. 사용자의 질문이 텍스트에 관한 것이든 이미지에 관한 것이든 친절하고 효과적으로 답변하며, 모든 유형의 질의에 대해 적절하고 유용한 응답을 제공하는 것이 당신의 역할입니다."""
instruction = '이미지에 대해서 설명해주세요.'
messages = [
{'role': 'system', 'content': f"{PROMPT}"},
{'role': 'user', 'content': f"<image>\n{instruction}"}
]
chat_messages = processor.tokenizer.apply_chat_template(messages,tokenize=False,add_generation_prompt=True)
inputs = processor(
chat_messages,
image,
return_tensors='pt',
).to('cuda:0')
output = model.generate(
**inputs,
max_new_tokens=1024,
)
print(processor.tokenizer.decode(output[0]))
Python code No Image
from transformers import LlavaNextForConditionalGeneration,LlavaNextProcessor
import torch
model = LlavaNextForConditionalGeneration.from_pretrained('Bllossom/llama-3.1-Korean-Bllossom-Vision-8B', torch_dtype=torch.bfloat16)
processor = LlavaNextProcessor.from_pretrained('Bllossom/llama-3.1-Korean-Bllossom-Vision-8B', torch_dtype=torch.bfloat16)
with torch.no_grad():
PROMPT=\
"""You are a versatile AI assistant named Bllava, capable of both understanding and generating text as well as interpreting and analyzing images. Your role is to kindly and effectively answer the user’s questions, whether they are about text or images, and provide appropriate and helpful responses to all types of queries.
당신은 텍스트를 이해하고 생성하는 것뿐만 아니라 이미지를 해석하고 분석할 수 있는 다재다능한 AI 어시스턴트 블라바입니다. 사용자의 질문이 텍스트에 관한 것이든 이미지에 관한 것이든 친절하고 효과적으로 답변하며, 모든 유형의 질의에 대해 적절하고 유용한 응답을 제공하는 것이 당신의 역할입니다."""
instruction = '자연어처리 15주 분량 커리큘럼을 짜줘'
messages = [
{'role': 'system', 'content': f"{PROMPT}"},
{'role': 'user', 'content': f"{instruction}"}
]
chat_messages = processor.tokenizer.apply_chat_template(
messages,
tokenize=True,
add_generation_prompt=True,
return_tensors='pt',
)
bos_token = processor.tokenizer.bos_token_id
chat_messages = torch.cat([torch.tensor([[bos_token]]),chat_messages],dim=-1).to('cuda:0')
output = model.generate(
input_ids = chat_messages,
use_cache=False,
max_new_tokens=2048,
top_p=0.9,
temperature=0.6,
do_sample=True,
)
print(processor.tokenizer.decode(output[0]))
Supported by
- Hewlett Packard (HP) Enterprise
- Common Crawl
- AICA
Citation
Language Model
@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
@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
- 신동재(Dongjae Shin), [email protected]
- 임현석(Hyeonseok Lim), [email protected]
- 원인호(Inho Won), [email protected]
- 김민준(Minjun Kim), [email protected]
- 유한결(Hangyeol Yoo), [email protected]
- 송승우(Seungwoo Song), [email protected]
- 육정훈(Jeonghun Yuk), [email protected]
- 최창수(Chansu Choi), [email protected]
- 송서현(Seohyun Song), [email protected]