Update README.md
Browse files
README.md
CHANGED
@@ -1,22 +1,68 @@
|
|
1 |
---
|
2 |
-
|
3 |
language:
|
|
|
4 |
- en
|
5 |
-
|
|
|
6 |
tags:
|
7 |
-
-
|
8 |
-
- transformers
|
9 |
-
- unsloth
|
10 |
-
- qwen2
|
11 |
-
- trl
|
12 |
---
|
13 |
|
14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
|
20 |
-
|
|
|
|
|
|
|
21 |
|
22 |
-
|
|
|
|
|
|
1 |
---
|
2 |
+
license: apache-2.0
|
3 |
language:
|
4 |
+
- ko
|
5 |
- en
|
6 |
+
base_model:
|
7 |
+
- unsloth/Qwen2-7B-Instruct
|
8 |
tags:
|
9 |
+
- krx
|
|
|
|
|
|
|
|
|
10 |
---
|
11 |
|
12 |
+
Sejong-Qwen-v2_inference.ipynb: [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)]()
|
13 |
+
|
14 |
+
# Usage:
|
15 |
+
|
16 |
+
|
17 |
+
``` python
|
18 |
+
!pip install transformers einops accelerate
|
19 |
+
!pip install qwen
|
20 |
+
!pip install unsloth
|
21 |
+
|
22 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
23 |
+
|
24 |
+
# ν ν¬λμ΄μ μ λͺ¨λΈ λ‘λ
|
25 |
+
tokenizer = AutoTokenizer.from_pretrained(
|
26 |
+
"SejongKRX/Sejong-Qwen-test-v2",
|
27 |
+
trust_remote_code=True,
|
28 |
+
use_fast=False
|
29 |
+
)
|
30 |
+
model = AutoModelForCausalLM.from_pretrained(
|
31 |
+
"SejongKRX/Sejong-Qwen-test-v2",
|
32 |
+
trust_remote_code=True
|
33 |
+
)
|
34 |
+
|
35 |
+
# μ
λ ₯ ν
μ€νΈ
|
36 |
+
input_text = """
|
37 |
+
λ€μ μ€ ννμ μκ°κ°μΉμ κ΄ν μ€λͺ
μΌλ‘ μ³μ§ μμ κ²μ 무μμΈκ°?
|
38 |
+
|
39 |
+
A. μ 볡리μ κ²½μ°, 맀μ μ μ©λλ μ΄μμ¨μ μ°κ° λͺ
λͺ© μ΄μμ¨μ 1/12λ‘ λλμ΄ μ°μΆνλ€.
|
40 |
+
B. ν¬μ μκΈ λ° κΈ°ν μ‘°κ±΄μ΄ λμΌν κ²½μ°, λ¨λ¦¬ λ°©μλ³΄λ€ λ³΅λ¦¬ λ°©μμμ λ°μνλ μ΄μκ° λ ν¬λ€.
|
41 |
+
C. μΌμλΆλ‘ μ§κΈλ κΈμ‘μ νμ¬ κ°μΉλ λ―Έλ κ°μΉλ₯Ό μΌμ κΈ°κ° λμ ν μΈμ¨μ μ μ©ν΄ μ°μΆν μ μλ€.
|
42 |
+
D. 1,000,000μμ μ° 5% λ³΅λ¦¬λ‘ 2λ
λμ μμΉνμ κ²½μ°, λ§κΈ°μ λ°μ μΈμ μ΄μλ 100,000μμ΄λ€.
|
43 |
+
|
44 |
+
### μ λ΅:
|
45 |
+
"""
|
46 |
+
|
47 |
+
inputs = tokenizer(input_text, return_tensors="pt")
|
48 |
+
|
49 |
+
# λͺ¨λΈμ μ¬μ©νμ¬ ν
μ€νΈ μμ±
|
50 |
+
output = model.generate(**inputs, max_new_tokens=1500)
|
51 |
+
|
52 |
+
# κ²°κ³Ό λμ½λ©
|
53 |
+
generated_text = tokenizer.decode(output[0], skip_special_tokens=True)
|
54 |
+
print(generated_text)
|
55 |
+
```
|
56 |
|
57 |
+
output:
|
58 |
+
```
|
59 |
+
λ€μ μ€ ννμ μκ°κ°μΉμ κ΄ν μ€λͺ
μΌλ‘ μ³μ§ μμ κ²μ 무μμΈκ°?
|
60 |
|
61 |
+
A. μ 볡리μ κ²½μ°, 맀μ μ μ©λλ μ΄μμ¨μ μ°κ° λͺ
λͺ© μ΄μμ¨μ 1/12λ‘ λλμ΄ μ°μΆνλ€.
|
62 |
+
B. ν¬μ μκΈ λ° κΈ°ν μ‘°κ±΄μ΄ λμΌν κ²½μ°, λ¨λ¦¬ λ°©μλ³΄λ€ λ³΅λ¦¬ λ°©μμμ λ°μνλ μ΄μκ° λ ν¬λ€.
|
63 |
+
C. μΌμλΆλ‘ μ§κΈλ κΈμ‘μ νμ¬ κ°μΉλ λ―Έλ κ°μΉλ₯Ό μΌμ κΈ°κ° λμ ν μΈμ¨μ μ μ©ν΄ μ°μΆν μ μλ€.
|
64 |
+
D. 1,000,000μμ μ° 5% λ³΅λ¦¬λ‘ 2λ
λμ μμΉνμ κ²½μ°, λ§κΈ°μ λ°μ μΈμ μ΄μλ 100,000μμ΄λ€.
|
65 |
|
66 |
+
### μ λ΅:
|
67 |
+
D
|
68 |
+
```
|