File size: 3,503 Bytes
aa65694 d09ddc7 93c0a92 aa65694 d09ddc7 b9b00f7 d09ddc7 b9b00f7 d09ddc7 aa65694 d09ddc7 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
---
base_model: unsloth/qwen2.5-7b-bnb-4bit
language:
- en
license: apache-2.0
tags:
- text-generation-inference
- transformers
- unsloth
- qwen2
- trl
- krx
datasets:
- amphora/krx-sample-instructions
- mlabonne/open-perfectblend
---
# Usage:
``` python
!pip install transformers einops accelerate
!pip install qwen
!pip install unsloth
from transformers import AutoTokenizer, AutoModelForCausalLM
# ν ν¬λμ΄μ μ λͺ¨λΈ λ‘λ
tokenizer = AutoTokenizer.from_pretrained(
"SejongKRX/Sejong-Qwen-v6",
trust_remote_code=True,
use_fast=False
)
model = AutoModelForCausalLM.from_pretrained(
"SejongKRX/Sejong-Qwen-v6",
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)μμ νμΈν μ μμ΅λλ€.
# Uploaded model
- **Developed by:** SejongKRX
- **License:** apache-2.0
- **Finetuned from model :** unsloth/qwen2.5-7b-bnb-4bit
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) |