|
--- |
|
base_model: SejongKRX/Sejong-Qwen-v1 |
|
language: |
|
- en |
|
license: apache-2.0 |
|
tags: |
|
- text-generation-inference |
|
- transformers |
|
- unsloth |
|
- qwen2 |
|
- trl |
|
- krx |
|
--- |
|
|
|
# Uploaded model |
|
|
|
- **Developed by:** SejongKRX |
|
- **License:** apache-2.0 |
|
- **Finetuned from model :** SejongKRX/Sejong-Qwen-v1 |
|
|
|
This qwen2 model was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth) and Huggingface's TRL library. |
|
|
|
[<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth) |
|
|
|
|
|
# Usage: |
|
|
|
Sejong-Qwen-v3_inference.ipynb: [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1c1CveM-_JbTM1VXle_2_10brxLZsUXF1?usp=sharing) |
|
|
|
|
|
``` python |
|
!pip install transformers einops accelerate |
|
!pip install qwen |
|
!pip install unsloth |
|
|
|
from transformers import AutoTokenizer, AutoModelForCausalLM |
|
|
|
# ν ν¬λμ΄μ μ λͺ¨λΈ λ‘λ |
|
tokenizer = AutoTokenizer.from_pretrained( |
|
"SejongKRX/Sejong-Qwen-3", |
|
trust_remote_code=True, |
|
use_fast=False |
|
) |
|
model = AutoModelForCausalLM.from_pretrained( |
|
"SejongKRX/Sejong-Qwen-3", |
|
trust_remote_code=True |
|
) |
|
|
|
# μ
λ ₯ ν
μ€νΈ |
|
input_text = """ |
|
λ€μ μ€ ννμ μκ°κ°μΉμ κ΄ν μ€λͺ
μΌλ‘ μ³μ§ μμ κ²μ 무μμΈκ°? |
|
|
|
A. μ 볡리μ κ²½μ°, 맀μ μ μ©λλ μ΄μμ¨μ μ°κ° λͺ
λͺ© μ΄μμ¨μ 1/12λ‘ λλμ΄ μ°μΆνλ€. |
|
B. ν¬μ μκΈ λ° κΈ°ν μ‘°κ±΄μ΄ λμΌν κ²½μ°, λ¨λ¦¬ λ°©μλ³΄λ€ λ³΅λ¦¬ λ°©μμμ λ°μνλ μ΄μκ° λ ν¬λ€. |
|
C. μΌμλΆλ‘ μ§κΈλ κΈμ‘μ νμ¬ κ°μΉλ λ―Έλ κ°μΉλ₯Ό μΌμ κΈ°κ° λμ ν μΈμ¨μ μ μ©ν΄ μ°μΆν μ μλ€. |
|
D. 1,000,000μμ μ° 5% λ³΅λ¦¬λ‘ 2λ
λμ μμΉνμ κ²½μ°, λ§κΈ°μ λ°μ μΈμ μ΄μλ 100,000μμ΄λ€. |
|
|
|
### μ λ΅: |
|
""" |
|
|
|
inputs = tokenizer(input_text, return_tensors="pt") |
|
|
|
# λͺ¨λΈμ μ¬μ©νμ¬ ν
μ€νΈ μμ± |
|
output = model.generate(**inputs, max_new_tokens=1500) |
|
|
|
# κ²°κ³Ό λμ½λ© |
|
generated_text = tokenizer.decode(output[0], skip_special_tokens=True) |
|
print(generated_text) |
|
``` |
|
|
|
output: |
|
``` |
|
λ€μ μ€ ννμ μκ°κ°μΉμ κ΄ν μ€λͺ
μΌλ‘ μ³μ§ μμ κ²μ 무μμΈκ°? |
|
|
|
A. μ 볡리μ κ²½μ°, 맀μ μ μ©λλ μ΄μμ¨μ μ°κ° λͺ
λͺ© μ΄μμ¨μ 1/12λ‘ λλμ΄ μ°μΆνλ€. |
|
B. ν¬μ μκΈ λ° κΈ°ν μ‘°κ±΄μ΄ λμΌν κ²½μ°, λ¨λ¦¬ λ°©μλ³΄λ€ λ³΅λ¦¬ λ°©μμμ λ°μνλ μ΄μκ° λ ν¬λ€. |
|
C. μΌμλΆλ‘ μ§κΈλ κΈμ‘μ νμ¬ κ°μΉλ λ―Έλ κ°μΉλ₯Ό μΌμ κΈ°κ° λμ ν μΈμ¨μ μ μ©ν΄ μ°μΆν μ μλ€. |
|
D. 1,000,000μμ μ° 5% λ³΅λ¦¬λ‘ 2λ
λμ μμΉνμ κ²½μ°, λ§κΈ°μ λ°μ μΈμ μ΄μλ 100,000μμ΄λ€. |
|
|
|
### μ λ΅: |
|
D |
|
``` |
|
|
|
|
|
# Dataset |
|
|
|
λ³Έ λͺ¨λΈμ λ€μν μΆμ²μ λ°μ΄ν°(mlabonne/open-perfectblend, Wikipedia, νκ΅μνμ 곡곡 λ°μ΄ν° λ±)λ₯Ό νμ©νμ¬ νμ΅λμμΌλ©°, λͺ¨λ λ°μ΄ν°λ μ μκΆ λ° μ¬μ© μ μ±
μ λ°λΌ μ μ ν μ¬μ©λμμ΅λλ€. |
|
|
|
- Wikipedia λ°μ΄ν°λ CC BY-SA 4.0 λΌμ΄μ μ€λ₯Ό λ°λ¦
λλ€. μμΈν μ 보λ [μ¬κΈ°](https://creativecommons.org/licenses/by-sa/4.0/)μμ νμΈν μ μμ΅λλ€. |
|
- νκ΅μνμ λ°μ΄ν°λ νκ΅μνμ [μ μκΆ λ³΄νΈλ°©μΉ¨](https://www.bok.or.kr)μ λ°λΌ μ¬μ©λμμ΅λλ€. |
|
- [mlabonne/open-perfectblend](https://huggingface.co/datasets/mlabonne/open-perfectblend) λ°μ΄ν°λ Apache 2.0 λΌμ΄μ μ€λ₯Ό λ°λ¦
λλ€. λΌμ΄μ μ€μ λν μμΈν λ΄μ©μ [Apache 2.0 λΌμ΄μ μ€](https://www.apache.org/licenses/LICENSE-2.0)μμ νμΈν μ μμ΅λλ€. |