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