Update README.md
Browse files
README.md
CHANGED
@@ -9,6 +9,7 @@ tags:
|
|
9 |
- unsloth
|
10 |
- qwen2
|
11 |
- trl
|
|
|
12 |
---
|
13 |
|
14 |
# Uploaded model
|
@@ -20,3 +21,69 @@ tags:
|
|
20 |
This qwen2 model was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth) and Huggingface's TRL library.
|
21 |
|
22 |
[<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
- unsloth
|
10 |
- qwen2
|
11 |
- trl
|
12 |
+
- krx
|
13 |
---
|
14 |
|
15 |
# Uploaded model
|
|
|
21 |
This qwen2 model was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth) and Huggingface's TRL library.
|
22 |
|
23 |
[<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)
|
24 |
+
|
25 |
+
|
26 |
+
# Usage:
|
27 |
+
|
28 |
+
|
29 |
+
``` python
|
30 |
+
!pip install transformers einops accelerate
|
31 |
+
!pip install qwen
|
32 |
+
!pip install unsloth
|
33 |
+
|
34 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
35 |
+
|
36 |
+
# ν ν¬λμ΄μ μ λͺ¨λΈ λ‘λ
|
37 |
+
tokenizer = AutoTokenizer.from_pretrained(
|
38 |
+
"SejongKRX/Sejong-Qwen-3",
|
39 |
+
trust_remote_code=True,
|
40 |
+
use_fast=False
|
41 |
+
)
|
42 |
+
model = AutoModelForCausalLM.from_pretrained(
|
43 |
+
"SejongKRX/Sejong-Qwen-3",
|
44 |
+
trust_remote_code=True
|
45 |
+
)
|
46 |
+
|
47 |
+
# μ
λ ₯ ν
μ€νΈ
|
48 |
+
input_text = """
|
49 |
+
λ€μ μ€ ννμ μκ°κ°μΉμ κ΄ν μ€λͺ
μΌλ‘ μ³μ§ μμ κ²μ 무μμΈκ°?
|
50 |
+
|
51 |
+
A. μ 볡리μ κ²½μ°, 맀μ μ μ©λλ μ΄μμ¨μ μ°κ° λͺ
λͺ© μ΄μμ¨μ 1/12λ‘ λλμ΄ μ°μΆνλ€.
|
52 |
+
B. ν¬μ μκΈ λ° κΈ°ν μ‘°κ±΄μ΄ λμΌν κ²½μ°, λ¨λ¦¬ λ°©μλ³΄λ€ λ³΅λ¦¬ λ°©μμμ λ°μνλ μ΄μκ° λ ν¬λ€.
|
53 |
+
C. μΌμλΆλ‘ μ§κΈλ κΈμ‘μ νμ¬ κ°μΉλ λ―Έλ κ°μΉλ₯Ό μΌμ κΈ°κ° λμ ν μΈμ¨μ μ μ©ν΄ μ°μΆν μ μλ€.
|
54 |
+
D. 1,000,000μμ μ° 5% λ³΅λ¦¬λ‘ 2λ
λμ μμΉνμ κ²½μ°, λ§κΈ°μ λ°μ μΈμ μ΄μλ 100,000μμ΄λ€.
|
55 |
+
|
56 |
+
### μ λ΅:
|
57 |
+
"""
|
58 |
+
|
59 |
+
inputs = tokenizer(input_text, return_tensors="pt")
|
60 |
+
|
61 |
+
# λͺ¨λΈμ μ¬μ©νμ¬ ν
μ€νΈ μμ±
|
62 |
+
output = model.generate(**inputs, max_new_tokens=1500)
|
63 |
+
|
64 |
+
# κ²°κ³Ό λμ½λ©
|
65 |
+
generated_text = tokenizer.decode(output[0], skip_special_tokens=True)
|
66 |
+
print(generated_text)
|
67 |
+
```
|
68 |
+
|
69 |
+
output:
|
70 |
+
```
|
71 |
+
λ€μ μ€ ννμ μκ°κ°μΉμ κ΄ν μ€λͺ
μΌλ‘ μ³μ§ μμ κ²μ 무μμΈκ°?
|
72 |
+
|
73 |
+
A. μ 볡리μ κ²½μ°, 맀μ μ μ©λλ μ΄μμ¨μ μ°κ° λͺ
λͺ© μ΄μμ¨μ 1/12λ‘ λλμ΄ μ°μΆνλ€.
|
74 |
+
B. ν¬μ μκΈ λ° κΈ°ν μ‘°κ±΄μ΄ λμΌν κ²½μ°, λ¨λ¦¬ λ°©μλ³΄λ€ λ³΅λ¦¬ λ°©μμμ λ°μνλ μ΄μκ° λ ν¬λ€.
|
75 |
+
C. μΌμλΆλ‘ μ§κΈλ κΈμ‘μ νμ¬ κ°μΉλ λ―Έλ κ°μΉλ₯Ό μΌμ κΈ°κ° λμ ν μΈμ¨μ μ μ©ν΄ μ°μΆν μ μλ€.
|
76 |
+
D. 1,000,000μμ μ° 5% λ³΅λ¦¬λ‘ 2λ
λμ μμΉνμ κ²½μ°, λ§κΈ°μ λ°μ μΈμ μ΄μλ 100,000μμ΄λ€.
|
77 |
+
|
78 |
+
### μ λ΅:
|
79 |
+
D
|
80 |
+
```
|
81 |
+
|
82 |
+
|
83 |
+
# Dataset
|
84 |
+
|
85 |
+
λ³Έ λͺ¨λΈμ λ€μν μΆμ²μ λ°μ΄ν°(mlabonneμ open-perfectblend, Wikipedia, νκ΅μνμ 곡곡 λ°μ΄ν° λ±)λ₯Ό νμ©νμ¬ νμ΅λμμΌλ©°, λͺ¨λ λ°μ΄ν°λ μ μκΆ λ° μ¬μ© μ μ±
μ λ°λΌ μ μ ν μ¬μ©λμμ΅λλ€.
|
86 |
+
|
87 |
+
- Wikipedia λ°μ΄ν°λ CC BY-SA 4.0 λΌμ΄μ μ€λ₯Ό λ°λ¦
λλ€. μμΈν μ 보λ [μ¬κΈ°](https://creativecommons.org/licenses/by-sa/4.0/)μμ νμΈν μ μμ΅λλ€.
|
88 |
+
- νκ΅μνμ λ°μ΄ν°λ νκ΅μνμ [μ μκΆ λ³΄νΈλ°©μΉ¨](https://www.bok.or.kr)μ λ°λΌ μ¬μ©λμμ΅λλ€.
|
89 |
+
- mlabonneμ open-perfectblend λ°μ΄ν°λ Apache 2.0 λΌμ΄μ μ€λ₯Ό λ°λ¦
λλ€. λΌμ΄μ μ€μ λν μμΈν λ΄μ©μ [Apache 2.0 λΌμ΄μ μ€](https://www.apache.org/licenses/LICENSE-2.0)μμ νμΈν μ μμ΅λλ€.
|