본문 바로가기
코딩/모델 리뷰

모델리뷰 : 일본어 한국어 잘하는 OrionStarAI의 Orion-14B

by 킹형 2024. 1. 25.
728x90
300x250

https://github.com/OrionStarAI/Orion

'Orion-14B'는 'OrionStarAI'가 개발한 공개된 소스의 다국어 대규모 언어 모델입니다. 이 모델은 중국어, 영어, 일본어, 한국어를 비롯한 2.5T 다국어 코퍼스에서 학습되었으며, 이 언어들에서 우수한 성능을 보여주고 있습니다.

이 모델은 OrionStarAI 의해 개발되었으며, 베이스 모델은 20B 모델 내에서 종합적인 평가에서 뛰어난 성능을 보입니다. 특히, 일본어와 한국어 테스트에서 탁월한 성과를 거두고 있습니다. 롱채팅 버전은 200k 토큰 길이에서 매우 효과적인 성능을 보여주며, 최대 320k까지 지원 가능합니다. 또한, 양자화 버전은 모델 크기가 70% 감소하고 추론 속도가 30% 향상되었으며, 성능 손실은 1% 미만입니다.

이 모델이 상당히 한국어를 잘하는거 같고 빠르기 때문에 번역에 퀄리티가 상당히 높습니다. 

OrionStarAI/Orion-14B-Base
OrionStarAI/Orion-14B-Chat
OrionStarAI/Orion-14B-LongChat
OrionStarAI/Orion-14B-Chat-RAG
OrionStarAI/Orion-14B-Chat-Plugin
OrionStarAI/Orion-14B-Base-Int4
OrionStarAI/Orion-14B-Chat-Int4

!pip install -q -U transformers accelerate bitsandbytes
!pip install -q -U sentencepiece flash_attn autoawq

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from transformers.generation.utils import GenerationConfig

# Tokenizer와 모델을 준비합니다.
tokenizer = AutoTokenizer.from_pretrained(
    "OrionStarAI/Orion-14B-Chat-Int4",
    use_fast=False,
    trust_remote_code=True
)
model = AutoModelForCausalLM.from_pretrained(
    "OrionStarAI/Orion-14B-Chat-Int4",
    device_map="auto",
    torch_dtype=torch.bfloat16,
    trust_remote_code=True
)
model.generation_config = GenerationConfig.from_pretrained(
    "OrionStarAI/Orion-14B-Chat-Int4"
)

# 메시지 목록을 준비합니다.
messages = [
    {"role": "user", "content": """```With a heavy snow advisory in effect centered on the Chungcheong and Jeolla provinces, frozen water meters, canceled flights and restricted ship operations have been reported across the country.
No human lives have been lost due to the cold wave and snowfall, but there were damages to facilities across the country as of Tuesday afternoon, according to the Central Disaster and Safety Countermeasures Headquarters.
There were 58 cases of damage related to water facilities, including water meters and pipes, in Seoul, Incheon and Gyeonggi Province. In response, the Seoul Metropolitan Government issued an alert on freezing of water gauges on Monday. The alert is to last until 9 a.m. Thursday. The warning is the third stage of a four-stage water meter freeze forecasting system and is issued when the lowest temperature is below minus 10 degrees Celsius for two consecutive days.
A total of 97 flights, including 85 domestic flights and 12 international flights, at Jeju International Airport had been canceled or preempted as of 7 a.m. on Tuesday. Thirty-five flights were canceled and 200 flights were delayed Monday. Currently, warnings of snowfall, strong wind and rapidly changing wind have been issued in Jeju Island.
Strong winds also affected the sea, with only two routes out of ten in operation. Seven out of ten passenger ships for Jeju Island had also been stopped.
Access to 162 trails in nine national parks, including Seoraksan, Mudeungsan and Bukhansan, was restricted.
The cold wave that struck the country from Monday is expected to further freeze the nation, keeping daytime temperatures below the freezing point in most regions, according to the Korea Meteorological Administration.```을 번역해라."""}
]

# 추론 실행
response = model.chat(tokenizer, messages, streaming=False)
print(response)

저 정도의 텍스트를 쓰는데 27초 밖에 걸리지 않았습니다. 상당히 빠른 속도를 볼 수 있습니다. 

생성된 결과도 충분히 좋은 수준의 결과물을 확인 할수 있고, 고유명사에도 적당히 강한모습을 볼 수 있습니다.

"중부와 전라 지방을 중심으로 한 중대한 폭설 경보로 인해 전국적으로 물 공급 시설의 손상, 항공편 취소 및 선박 운항 제한 등의 피해가 발생했습니다. 중앙 재난안전대책본부에 따르면 인명 피해는 없었지만 시설물에 대한 피해는 화요일 오후까지 집계된 것으로 알려졌습니다. 서울, 인천, 경기도에서는 58건의 수도 시설 피해가 보고되었으며, 이에 대응하여 서울시는 화요일부터 목요일 오전 9시까지 수도계량기 동파 경보를 발령했습니다. 이 경보는 4단계 수도계량기 동파 예보 시스템에서 3단계 경보로 발령되며, 2일 연속으로 영하의 기온이 지속될 것으로 예상될 때 발령됩니다. 제주 국제공항에서는 7시 현재 97편의 항공기(85편의 국내 항공편과 12편의 국제항공편)가 취소되거나 결항했으며, 월요일에는 35편의 항공편이 취소되고 200편의 항공편이 지연되었습니다. 현재 제주의 공항에는 눈보라, 강풍, 급변하는 바람에 대한 경보가 발령되어 있습니다. 강한 바람은 바다에도 영향을 미쳐 10개 항로 중 2개만 운영되고 있으며, 10개 여객선 중 7개가 중단되었습니다. 9개 국립공원 중 162개의 등산로가 제한되었습니다. 한국 기상청에 따르면 이번 추위로 인해 대부분의 지역에서 낮 최고 기온이 영하로 떨어지는 등 전국적으로 더욱 심한 추위가 예상됩니다."

728x90
300x250