๐ Kogpt-J-350m Model
Kogpt-J-350m is a text generation model based on the GPT - J architecture, trained on various Korean datasets to generate high - quality Korean text.
๐ Quick Start
You can use the following code to quickly start using the model:
from transformers import pipeline
model_name = "heegyu/kogpt-j-350m"
pipe = pipeline('text-generation', model=model_name)
print(pipe("์๋
ํ์ธ์", repetition_penalty=1.2, do_sample=True, eos_token_id=1, early_stopping=True, max_new_tokens=128))
print(pipe("์ค๋ ์ ๋ถ ๋ฐํ์ ๋ฐ๋ฅด๋ฉด, ", repetition_penalty=1.2, do_sample=True, eos_token_id=1, early_stopping=True, max_new_tokens=128))
print(pipe("์ธ๋ํ๋ค. ๊ฐ์ด์ ๋น์๊ฐ ๋ ์์ ๊ฝํ๋ค. ", repetition_penalty=1.2, do_sample=True, eos_token_id=1, early_stopping=True, max_new_tokens=128, min_length=64))
โจ Features
Model Configuration
- GPT - J (Flax, Pytorch)
- 20 Layers, 1024 hidden dim, 4096 intermediate, 16 heads, 51200 vocab size
- 1024 max_seq_len
- Number of parameters: 350M
Performance Benchmark

๐ง Technical Details
Training Environment and Hyperparameters
- TPU V2 - 8
- Learning Rate: 3e - 4, Batch Size: 512(=64 accum x 8 devices), Scheduler: Linear, WarmUp: 1000 step
- adam_beta1 = 0.9, adam_beta2 = 0.98, weight_decay = 0.01
- Training Steps: 43247 (3 epoch)
- Number of training tokens: 21.11B (43247 * 512 * 1024seq / 1024^3)
- Training period: 2023/1/25 ~ 2023/1/29
Training Datasets
- AIHub SNS Conversations (730MB)
- AIHub Spoken Language (422MB)
- AIHub Books (1.6MB)
- AIHub Large - scale Web - based Korean Corpus (12GB)
- Korean Wikipedia (867MB)
- NamuWiki (6.4GB)
- National Institute of Korean Language Messenger Conversations (21MB)
- National Institute of Korean Language Daily Conversation Corpus (23MB)
- National Institute of Korean Language Written Language Corpus (3.2GB)
- National Institute of Korean Language Spoken Language Corpus (1.1GB)
- National Institute of Korean Language Newspaper Corpus (~2022, 17GB)
- Blue House Citizen Petitions (525MB)
The dataset size is based on the pre - processed jsonl files. The total number of tokens is approximately 7B.
๐ป Usage Examples
Basic Usage
from transformers import pipeline
model_name = "heegyu/kogpt-j-350m"
pipe = pipeline('text-generation', model=model_name)
print(pipe("์๋
ํ์ธ์", repetition_penalty=1.2, do_sample=True, eos_token_id=1, early_stopping=True, max_new_tokens=128))
print(pipe("์ค๋ ์ ๋ถ ๋ฐํ์ ๋ฐ๋ฅด๋ฉด, ", repetition_penalty=1.2, do_sample=True, eos_token_id=1, early_stopping=True, max_new_tokens=128))
print(pipe("์ธ๋ํ๋ค. ๊ฐ์ด์ ๋น์๊ฐ ๋ ์์ ๊ฝํ๋ค. ", repetition_penalty=1.2, do_sample=True, eos_token_id=1, early_stopping=True, max_new_tokens=128, min_length=64))
Results:
[{'generated_text': '์๋
ํ์ธ์?\n๋ค.\n์~ ์ค๋ ๊ทธ~ ๋ญ~ ๋จ๋ถ์ ์ํ๋ด์์ ์ธ์ ๋จ๋ถ ๊ด๊ณ์ ๊ด๋ จ๋ ๋ฐ์ธ์ด์ฃ ?\n์. ๊ทธ๋ ์ต๋๋ค.\n์ด~ ๊ทธ~ ์ด์ฐ๊ฐ์กฑ ๋ฌธ์ ๊ด๋ จํด์ ์ด์ฐ๊ฐ์กฑ ์๋ด์\n์.\nํ๋ ๋ฐฉ์์ด ์ข ๊ฐ๋ฅ์ฑ์ด ์์ง ์์์?\n์๋นํ ๊ฐ๋ฅ์ฑ์ด ์์ฃ .\n์. ์ด~ ๊ตฌ์ฒด์ ์ผ๋ก ์ด๋ค ๊ฑฐ์๋์?\n์ด~ ๋จผ์ ์ด์ฐ๊ฐ์กฑ ์๋ด์ ์ด์ ๋ง์๋๋ฆฌ๊ฒ ์ต๋๋ค.\n์.\n์๊น ์ค๋ช
๋๋ฆฐ ๊ฒ์ฒ๋ผ ๊ทธ~ ์ด์ฐ๊ฐ์กฑ ์\n๋ค.\n๊ทธ~ ์๋ด์ ๋ํ ๊ทธ~ ๊ตฌ์ฒด์ ์ธ ๋ฐฉ์์ด ์ด๋ป๊ฒ ๊ฒฐ์ ๋๋ ๊ฒ ๊ฐ์ฅ ์ข์๊น์?\n์ฐ์ ์๋ด ๋ฐฉ๋ฒ๋ถํฐ ์๊ธฐ๋ฅผ ๋๋ฆฌ์ฃ .\n'}]
[{'generated_text': '์ค๋ ์ ๋ถ ๋ฐํ์ ๋ฐ๋ฅด๋ฉด, gtx-d d ๋
ธ์ ์ ์ฐฝ๋ฆ๊ณผ ์์์์ ์ถ๋ฐํ๋ ๋ฑ ๋น์ด ์์ ๋ ๋
ธ์ ๋ค์ ๋ชจ๋ ์ ์ฐจํ๊ธฐ๋ก ํ๋ค. ์ง๋ 2์ ๊ตญํ ๊ตํต๋ถ๊ฐ ์ด ๋
ธ์ ์ ์ผ์ฐยท๊ธ์ ยทํ์ฃผ ์ด์ ์ญ๊ณผ ์ง์ ์ฐ๊ฒฐํค๋ก ํ๋ฉด์ ์ผ์ฐ~๋ํ, ์ผ์ฐ~๋ถ๋น, ์ผ์ฐ~์์ฌ ๊ตฌ๊ฐ์ ์ถ๊ฐ ์ ์ฐจํ ๊ฒ์ด๋ผ๋ ์์์ด ๋์์ง๋ง ์ค์ ์ผ์ฐ~์์ ๊ตฌ๊ฐ์ด ์ ์ฐจํ๊ธฐ๋ก ํ์ ๋๋ค. gtx-d ๋
ธ์ ์ด ์ผ์ฐ~์์์ญ๊น์ง ๊ฐํต๋๋ ๊ฒ์ ์ด๋ฒ์ด ์ฒ์์ด๋ค.. gtx-d ๋
ธ์ ๊ณผ gtx-a ๋
ธ์ ์ด ๋ชจ๋ ๊ฐํต๋๋ฉด ์งํ์ฒ 5ํธ์ ์ ์์ธ ๋์ฌ ํต๊ณผ ๊ตฌ๊ฐ์ด ์ถ๊ฐ๋๋ค. ํ์ฌ gtx-b'}]
[{'generated_text': '์ธ๋ํ๋ค. ๊ฐ์ด์ ๋น์๊ฐ ๋ ์์ ๊ฝํ๋ค. \U000f0854์ผ๊ตญ์ฌ์ ์\U000f0855 โํ์ด์ด์ด ์ธ๋ฒ๋ฆฐโ์ ๊ฒฝ์ฐ์์ ๋ณด๋ฉด, ์ด์๋ฆฌ์ ์์์ ้(์ข
์์ฉ : ์ก์
), ้์ ๋น(้)๋ผ ํ๊ณ ์ข
์์ ๋ฐ์์ โ์ด( )โ์ด๋ค. ์ด๋์์ โ์ด(์)๋ก ์์ํ๋ ๋ฐ์โ์ โ์ด/์ดโ์ ์์ด์ ํํ์ด๋ค. โ์ด/์โ์ข
์์ฉ[้] โ ์ก์
/์ข
์[้]โ์ดโ์ข
์(้) โฆโ์ด๋ค. ์ด๋ ํ์์ด๋ก์ ๊ทธ ๋ฐ์'}]
๐ License
This project is licensed under the MIT license.
โ ๏ธ Important Note
The training data of this model may contain various forms of discriminatory/hateful data, and no separate removal work has been carried out. Therefore, the sentences generated by the model may contain discriminatory/hateful remarks against specific individuals, races, genders, or disabilities.