Marker-Inc-Korea/KO-Platypus

[KO-Platy🥮] Korean-Open-platypus를 활용하여 llama-2-ko를 fine-tuning한 KO-platypus model

73

stars

129

commits

Jupyter Notebook

primary language

Aug 24, 2025

updated

huggingface.co/kyujinpy/KO-Platypus2-7B-ex
english
huggingface
ko-platypus
korean
llama-2
llm
platypus

README

KO-Platypus (Ko-Platy🥮)

KO-platypus

Korean-Open-platypus 데이터셋을 활용하여 llama-2-ko를 fine-tuning한 Korean-Platypus model

🐳KoR-Orca-Platypus-13B🥮: Hugging Face
KoT-Platypus2-13B🥮: Hugging Face
KO-Platypus2-13B🥮: Hugging Face
CoTy-platypus-ko🥮: Hugging Face
KoT-platypus2-7B🥮: Hugging Face
KO-Platypus2-7B🥮: Hugging Face
Poly-platypus-ko🥮: Hugging Face

KOpen-Platypus🥮: Hugging Face
본 연구는 (주)마커와 (주)미디어그룹사람과숲의 오픈소스 LLM 연구 컨소시엄에서 진행되었습니다.


Introduction

  • 최근 llama-2 등장으로 LLM 분야가 다시 활발해지는 가운데, Open-Platypus 데이터셋 활용하여 llama-2를 fine-tuning한 Platpyus 모델이 등장하였습니다!🤗

  • 하지만 Open-Platypus 데이터셋은 대부분 영어로만 구성되어 있기 때문에 한국어에 접목하기에는 한계가 있었습니다.

  • 이것을 동기부여로 삼아서, 한국어 기반의 Open-Platypus 데이터셋을 제작한 후, Ko-Platypus를 만들기로 계획하였습니다!🙂🙂

  • Open-Platypus를 DeepL Pro API를 활용하여 번역을 진행한 후, 약 25,000개의 데이터를 수작업으로 체크하였고 약 144시간 정도 소요하여서 번역 오류를 대부분 고쳤습니다😭😭

  • 이렇게 만들어진 🥮KOpen-Platypus🥮 데이터셋을 활용하여 beomi님의 llama-2-ko 모델을 fine-tuning 하였습니다.

  • 결과적으로 Ko-Platypus2-7B-EX 모델을 만들게 되었고✌, 성능평가를 위해 Polyglot-Ko와 llama-2-ko 모델과 비교를 진행했습니다.🙂🙃

Model BenchMark(KO-LLM; old version)

ModelAverageKo-ARCKo-HellaSwagKo-MMLUKo-TruthfulQAKo-CommonGen V2DatasetBase_model
🐳KoR-Orca-Platypus-13B50.1342.0653.9542.2843.5568.78KOR-OpenOrca-Platypusko-en-llama2-13b
KoT-Platypus2-13B49.5543.6953.0542.2943.3465.38KoCoTKO-platypus2-13B
KO-platypus2-13B47.9044.2054.3142.4744.4154.11KOpen-platyusko-en-llama2-13b
CoTy-platypus-ko-12.8b46.4434.9849.1125.6837.5984.86KoCoTPoly-playtypus-ko-12.8b
KoT-platypus2-7B45.6238.0549.6334.6837.6968.08KoCoTKO-platypus2-7B
KO-Platypus2-7B45.4139.0850.8634.6037.9464.55KOpen-platyusllama-2-ko-7B
Poly-platypus-ko-12.8b44.9535.1550.3925.6838.7474.88KOpen-platyusPolyglot-ko-12.8b
CoT-llama-2k-7b41.5436.7749.3829.8037.7653.99KoCoTllama-2-ko-7B

Model Description

KO-Platypus2-7B-ex

  • llama-2-ko-7B를 fine-tuning한 모델
  • 🥮KO-Platypus2-7B-ex🥮 모델은 zero-shot에서 llama-2-ko보다 높은 성능을 보여주었고, BoolQ의 경우에는 Polyglot-Ko보다 높은 성능을 보여주었습니다.✌✌

News

Quick start

### KO-Platy
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch

repo = "kyujinpy/KO-Platypus2-7B-ex"
ko_platypus = AutoModelForCausalLM.from_pretrained(
        repo,
        return_dict=True,
        torch_dtype=torch.float16,
        device_map='auto'
)
ko_platypus_tokenizer = AutoTokenizer.from_pretrained(repo)

Training

  1. First download the origina repo Platypus
  2. 🥮Run the file🥮: Training Code

*Note: You must access the original llama-2.
**Note: You must generate your huggingface token. And after login, you can implement this colab.
***Note: If you run Platypus in colab, you must use A100 GPU.

Datasets

from datasets import load_dataset

# dataset testing
dataset = load_dataset("kyujinpy/KOpen-platypus")

KOpen-Platypus🥮: Hugging Face

I think that KOpen-Platypus is higher quality korean-translation dataset than just using DeepL. Because I almost check translation-error.

Procedure

  • First, I use DeepL Pro API and Selenium Code.
  • Second, checking all data. If there are some errors, I modify translation myself. *If you want more detail, see below Post-procesing.

Post-processing

example I focus about 5 type errors.

  1. Result of just code
  2. Result of code+explanation
  3. Float missing
  4. Math symbol
  5. Not translation or cut off translation result

*Note: If you want to see more detail example, visit huggingface or Ko-Platypus-blog.

Performance(Old_version)

When I evaluated Ko-Platy, I used this repo.
And, implement below code.

# In colab,
!python main.py \
    --model gpt2 \ 
    --model_args pretrained=..your_model_name.. \
    --tasks kobest_hellaswag,kobest_copa,kobest_boolq,kobest_sentineg \
    --device cuda:0 \
    --num_fewshot 0 # 5, 10, 25, ...

COPA (F1)

Model0-shot5-shot10-shot50-shot
Polyglot-ko-1.3b0.71960.71930.72040.7206
Polyglot-ko-3.8b0.75950.76080.76380.7788
Polyglot-ko-5.8b0.77450.76760.77750.7887
Polyglot-ko-12.8b0.79370.81080.80370.8369
Llama-2-Ko-7b 20B0.73880.76260.78080.7979
Llama-2-Ko-7b 40B0.74360.79270.80370.8259
KO-platypus2-7B-EX(ours)0.75090.78990.80290.8290

HellaSwag (F1)

Model0-shot5-shot10-shot50-shot
Polyglot-ko-1.3b0.52470.52600.52780.5427
Polyglot-ko-3.8b0.57070.58300.56700.5787
Polyglot-ko-5.8b0.59760.59980.59790.6208
Polyglot-ko-12.8b0.59540.63060.60980.6118
Llama-2-Ko-7b 20B0.45180.46680.47260.4828
Llama-2-Ko-7b 40B0.45620.46570.46980.4774
KO-platypus2-7B-EX(ours)0.45710.44610.43710.4525

BoolQ (F1)

Model0-shot5-shot10-shot50-shot
Polyglot-ko-1.3b0.35520.47510.41090.4038
Polyglot-ko-3.8b0.43200.52630.49300.4038
Polyglot-ko-5.8b0.43560.56980.51870.5236
Polyglot-ko-12.8b0.48180.60410.62890.6448
Llama-2-Ko-7b 20B0.36070.67970.68010.6622
Llama-2-Ko-7b 40B0.57860.69770.70840.7144
KO-platypus2-7B-EX(ours)0.60280.69790.70160.6988

SentiNeg (F1)

Model0-shot5-shot10-shot50-shot
Polyglot-ko-1.3b0.67900.62570.55140.7851
Polyglot-ko-3.8b0.48580.79500.73200.7851
Polyglot-ko-5.8b0.33940.88410.88080.9521
Polyglot-ko-12.8b0.91170.90150.93450.9723
Llama-2-Ko-7b 20B0.48550.82950.87110.8513
Llama-2-Ko-7b 40B0.45940.76110.72760.9370
KO-platypus2-7B-EX(ours)0.58210.76530.79910.8643

References

Kopen-Platypus🥮
KO-Platypus2-7B-ex🥮
KO-Platypus2-13B🥮
Platypus
llama-2
llama-2-ko
ko-en-llama2
ko-lm-evaluation-harness

TODO

  • Make KO-Platypus-7B-EX
  • Share huggingface repo
  • Share evaluation results
  • Share sample code

Additional info about image

I made the image, inspired by Platypus-LLM.
I used Playground AI, then applying prompt engineering. (For example, img2img, guidance etc...)

When I made Ko-Platy image, I use prompt like below.

Prompt: 'Platypus wears a pretty traditional Korean clothes with 한국어 책'
Guidance: 10
Quality: 70~100
img2img: 'Platypus.png'
Model: SDXL

Contributors

KyujinHan

129 commits

Marker-Inc-Korea/KO-Platypus

[KO-Platy🥮] Korean-Open-platypus를 활용하여 llama-2-ko를 fine-tuning한 KO-platypus model

73

stars

129

commits

Jupyter Notebook

primary language

Aug 24, 2025

updated

huggingface.co/kyujinpy/KO-Platypus2-7B-ex
english
huggingface
ko-platypus
korean
llama-2
llm
platypus

README

KO-Platypus (Ko-Platy🥮)

KO-platypus

Korean-Open-platypus 데이터셋을 활용하여 llama-2-ko를 fine-tuning한 Korean-Platypus model

🐳KoR-Orca-Platypus-13B🥮: Hugging Face
KoT-Platypus2-13B🥮: Hugging Face
KO-Platypus2-13B🥮: Hugging Face
CoTy-platypus-ko🥮: Hugging Face
KoT-platypus2-7B🥮: Hugging Face
KO-Platypus2-7B🥮: Hugging Face
Poly-platypus-ko🥮: Hugging Face

KOpen-Platypus🥮: Hugging Face
본 연구는 (주)마커와 (주)미디어그룹사람과숲의 오픈소스 LLM 연구 컨소시엄에서 진행되었습니다.


Introduction

  • 최근 llama-2 등장으로 LLM 분야가 다시 활발해지는 가운데, Open-Platypus 데이터셋 활용하여 llama-2를 fine-tuning한 Platpyus 모델이 등장하였습니다!🤗

  • 하지만 Open-Platypus 데이터셋은 대부분 영어로만 구성되어 있기 때문에 한국어에 접목하기에는 한계가 있었습니다.

  • 이것을 동기부여로 삼아서, 한국어 기반의 Open-Platypus 데이터셋을 제작한 후, Ko-Platypus를 만들기로 계획하였습니다!🙂🙂

  • Open-Platypus를 DeepL Pro API를 활용하여 번역을 진행한 후, 약 25,000개의 데이터를 수작업으로 체크하였고 약 144시간 정도 소요하여서 번역 오류를 대부분 고쳤습니다😭😭

  • 이렇게 만들어진 🥮KOpen-Platypus🥮 데이터셋을 활용하여 beomi님의 llama-2-ko 모델을 fine-tuning 하였습니다.

  • 결과적으로 Ko-Platypus2-7B-EX 모델을 만들게 되었고✌, 성능평가를 위해 Polyglot-Ko와 llama-2-ko 모델과 비교를 진행했습니다.🙂🙃

Model BenchMark(KO-LLM; old version)

ModelAverageKo-ARCKo-HellaSwagKo-MMLUKo-TruthfulQAKo-CommonGen V2DatasetBase_model
🐳KoR-Orca-Platypus-13B50.1342.0653.9542.2843.5568.78KOR-OpenOrca-Platypusko-en-llama2-13b
KoT-Platypus2-13B49.5543.6953.0542.2943.3465.38KoCoTKO-platypus2-13B
KO-platypus2-13B47.9044.2054.3142.4744.4154.11KOpen-platyusko-en-llama2-13b
CoTy-platypus-ko-12.8b46.4434.9849.1125.6837.5984.86KoCoTPoly-playtypus-ko-12.8b
KoT-platypus2-7B45.6238.0549.6334.6837.6968.08KoCoTKO-platypus2-7B
KO-Platypus2-7B45.4139.0850.8634.6037.9464.55KOpen-platyusllama-2-ko-7B
Poly-platypus-ko-12.8b44.9535.1550.3925.6838.7474.88KOpen-platyusPolyglot-ko-12.8b
CoT-llama-2k-7b41.5436.7749.3829.8037.7653.99KoCoTllama-2-ko-7B

Model Description

KO-Platypus2-7B-ex

  • llama-2-ko-7B를 fine-tuning한 모델
  • 🥮KO-Platypus2-7B-ex🥮 모델은 zero-shot에서 llama-2-ko보다 높은 성능을 보여주었고, BoolQ의 경우에는 Polyglot-Ko보다 높은 성능을 보여주었습니다.✌✌

News

Quick start

### KO-Platy
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch

repo = "kyujinpy/KO-Platypus2-7B-ex"
ko_platypus = AutoModelForCausalLM.from_pretrained(
        repo,
        return_dict=True,
        torch_dtype=torch.float16,
        device_map='auto'
)
ko_platypus_tokenizer = AutoTokenizer.from_pretrained(repo)

Training

  1. First download the origina repo Platypus
  2. 🥮Run the file🥮: Training Code

*Note: You must access the original llama-2.
**Note: You must generate your huggingface token. And after login, you can implement this colab.
***Note: If you run Platypus in colab, you must use A100 GPU.

Datasets

from datasets import load_dataset

# dataset testing
dataset = load_dataset("kyujinpy/KOpen-platypus")

KOpen-Platypus🥮: Hugging Face

I think that KOpen-Platypus is higher quality korean-translation dataset than just using DeepL. Because I almost check translation-error.

Procedure

  • First, I use DeepL Pro API and Selenium Code.
  • Second, checking all data. If there are some errors, I modify translation myself. *If you want more detail, see below Post-procesing.

Post-processing

example I focus about 5 type errors.

  1. Result of just code
  2. Result of code+explanation
  3. Float missing
  4. Math symbol
  5. Not translation or cut off translation result

*Note: If you want to see more detail example, visit huggingface or Ko-Platypus-blog.

Performance(Old_version)

When I evaluated Ko-Platy, I used this repo.
And, implement below code.

# In colab,
!python main.py \
    --model gpt2 \ 
    --model_args pretrained=..your_model_name.. \
    --tasks kobest_hellaswag,kobest_copa,kobest_boolq,kobest_sentineg \
    --device cuda:0 \
    --num_fewshot 0 # 5, 10, 25, ...

COPA (F1)

Model0-shot5-shot10-shot50-shot
Polyglot-ko-1.3b0.71960.71930.72040.7206
Polyglot-ko-3.8b0.75950.76080.76380.7788
Polyglot-ko-5.8b0.77450.76760.77750.7887
Polyglot-ko-12.8b0.79370.81080.80370.8369
Llama-2-Ko-7b 20B0.73880.76260.78080.7979
Llama-2-Ko-7b 40B0.74360.79270.80370.8259
KO-platypus2-7B-EX(ours)0.75090.78990.80290.8290

HellaSwag (F1)

Model0-shot5-shot10-shot50-shot
Polyglot-ko-1.3b0.52470.52600.52780.5427
Polyglot-ko-3.8b0.57070.58300.56700.5787
Polyglot-ko-5.8b0.59760.59980.59790.6208
Polyglot-ko-12.8b0.59540.63060.60980.6118
Llama-2-Ko-7b 20B0.45180.46680.47260.4828
Llama-2-Ko-7b 40B0.45620.46570.46980.4774
KO-platypus2-7B-EX(ours)0.45710.44610.43710.4525

BoolQ (F1)

Model0-shot5-shot10-shot50-shot
Polyglot-ko-1.3b0.35520.47510.41090.4038
Polyglot-ko-3.8b0.43200.52630.49300.4038
Polyglot-ko-5.8b0.43560.56980.51870.5236
Polyglot-ko-12.8b0.48180.60410.62890.6448
Llama-2-Ko-7b 20B0.36070.67970.68010.6622
Llama-2-Ko-7b 40B0.57860.69770.70840.7144
KO-platypus2-7B-EX(ours)0.60280.69790.70160.6988

SentiNeg (F1)

Model0-shot5-shot10-shot50-shot
Polyglot-ko-1.3b0.67900.62570.55140.7851
Polyglot-ko-3.8b0.48580.79500.73200.7851
Polyglot-ko-5.8b0.33940.88410.88080.9521
Polyglot-ko-12.8b0.91170.90150.93450.9723
Llama-2-Ko-7b 20B0.48550.82950.87110.8513
Llama-2-Ko-7b 40B0.45940.76110.72760.9370
KO-platypus2-7B-EX(ours)0.58210.76530.79910.8643

References

Kopen-Platypus🥮
KO-Platypus2-7B-ex🥮
KO-Platypus2-13B🥮
Platypus
llama-2
llama-2-ko
ko-en-llama2
ko-lm-evaluation-harness

TODO

  • Make KO-Platypus-7B-EX
  • Share huggingface repo
  • Share evaluation results
  • Share sample code

Additional info about image

I made the image, inspired by Platypus-LLM.
I used Playground AI, then applying prompt engineering. (For example, img2img, guidance etc...)

When I made Ko-Platy image, I use prompt like below.

Prompt: 'Platypus wears a pretty traditional Korean clothes with 한국어 책'
Guidance: 10
Quality: 70~100
img2img: 'Platypus.png'
Model: SDXL

Contributors

KyujinHan

129 commits

Languages

Jupyter Notebook

100.0%