beomi commited on
Commit
574352e
โ€ข
1 Parent(s): 74f8071

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +217 -0
README.md ADDED
@@ -0,0 +1,217 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ - ko
5
+ license: cc-by-nc-sa-4.0
6
+ tags:
7
+ - facebook
8
+ - meta
9
+ - pytorch
10
+ - llama
11
+ - llama-3
12
+ - llama-3-ko
13
+ pipeline_tag: text-generation
14
+ license_name: llama3
15
+ license_link: LICENSE
16
+ ---
17
+
18
+ ## Llama-3-KoEn-8B-Instruct-preview
19
+
20
+ > Update @ 2024.05.01: Pre-Release [Llama-3-KoEn-8B model](https://huggingface.co/beomi/Llama-3-KoEn-8B-preview) & [Llama-3-KoEn-8B-Instruct-preview](https://huggingface.co/beomi/Llama-3-KoEn-8B-Instruct-preview)
21
+
22
+ ## Model Details
23
+
24
+ **Llama-3-KoEn-8B-Instruct-preview**
25
+
26
+ Llama-3-KoEn-8B model is continued pretrained language model based on Llama-3-8B.
27
+
28
+ The train was done on TPUv5e-256, with the warm support from TRC program by Google.
29
+
30
+ With applying the idea from [Chat Vector paper](https://arxiv.org/abs/2310.04799),
31
+ I released Instruction model named [Llama-3-KoEn-8B-Instruct-preview](https://huggingface.co/beomi/Llama-3-KoEn-8B-Instruct-preview).
32
+
33
+ Since it is NOT finetuned with any Korean instruction set(indeed `preview`), but it would be great starting point for creating new Chat/Instruct models.
34
+
35
+ **Sample usage**
36
+
37
+ ```python
38
+ from transformers import AutoTokenizer, AutoModelForCausalLM
39
+ import torch
40
+
41
+ model_id = "beomi/Llama-3-KoEn-8B-Instruct-preview"
42
+
43
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
44
+ model = AutoModelForCausalLM.from_pretrained(
45
+ model_id,
46
+ torch_dtype="auto",
47
+ device_map="auto",
48
+ )
49
+
50
+ messages = [
51
+ {"role": "system", "content": "์นœ์ ˆํ•œ ์ฑ—๋ด‡์œผ๋กœ์„œ ์ƒ๋Œ€๋ฐฉ์˜ ์š”์ฒญ์— ์ตœ๋Œ€ํ•œ ์ž์„ธํ•˜๊ณ  ์นœ์ ˆํ•˜๊ฒŒ ๋‹ตํ•˜์ž. ๋ชจ๋“  ๋Œ€๋‹ต์€ ํ•œ๊ตญ์–ด(Korean)์œผ๋กœ ๋Œ€๋‹ตํ•ด์ค˜."},
52
+ {"role": "user", "content": "ํ”ผ๋ณด๋‚˜์น˜ ์ˆ˜์—ด์ด ๋ญ์•ผ? ๊ทธ๋ฆฌ๊ณ  ํ”ผ๋ณด๋‚˜์น˜ ์ˆ˜์—ด์— ๋Œ€ํ•ด ํŒŒ์ด์ฌ ์ฝ”๋“œ๋ฅผ ์งœ์ค˜๋ณผ๋ž˜?"},
53
+ ]
54
+
55
+ input_ids = tokenizer.apply_chat_template(
56
+ messages,
57
+ add_generation_prompt=True,
58
+ return_tensors="pt"
59
+ ).to(model.device)
60
+
61
+ terminators = [
62
+ tokenizer.eos_token_id,
63
+ tokenizer.convert_tokens_to_ids("<|eot_id|>")
64
+ ]
65
+
66
+ outputs = model.generate(
67
+ input_ids,
68
+ max_new_tokens=512,
69
+ eos_token_id=terminators,
70
+ do_sample=True,
71
+ temperature=1,
72
+ top_p=0.9,
73
+ )
74
+ response = outputs[0][input_ids.shape[-1]:]
75
+ print(tokenizer.decode(response, skip_special_tokens=True))
76
+ ```
77
+
78
+ **Sample Output**
79
+
80
+ ํ”ผ๋ณด๋‚˜์น˜ ์ˆ˜์—ด์€ ์ดํƒˆ๋ฆฌ์•„ ์ˆ˜ํ•™์ž ๋ ˆ์˜ค๋‚˜๋ฅด๋„ ํ”ผ๋ณด๋‚˜์น˜์˜ ์ด๋ฆ„์„ ๋”ฐ์„œ ์œ ๋ž˜๋œ ์ˆ˜์—ด์ž…๋‹ˆ๋‹ค. ํ”ผ๋ณด๋‚˜์น˜ ์ˆ˜์—ด์€ ํŠน์ • ์กฐ๊ฑด์— ๋”ฐ๋ผ ์–ป์–ด์ง€๋Š” ๋“ฑ์ฐจ์ˆ˜์—ด๋กœ, ๋‹ค์Œ ์ˆ˜๋ฅผ ๊ตฌํ•˜๋Š” ๋‹จ์ˆœํ•œ ๊ทœ์น™์— ์˜ํ•ด ์ƒ์„ฑ๋˜๋Š” ์ˆ˜์—ด์ž…๋‹ˆ๋‹ค.
81
+
82
+ 1, 1, 2, 3, 5, 8, 13, 21,... (๋“ฑ์ฐจ ์ˆ˜์—ด)
83
+
84
+ ์ด๋Ÿฌํ•œ ์ˆ˜์—ด์€ ์ž์—ฐ ์„ธ๊ณ„์—๋„ ๋งŽ์ด ๋ฐœ๊ฒฌ๋ฉ๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด, ์ƒˆ์‹น์ด ์ž๋ผ๋Š” ๋ฐฉ์‹, ๋‹ฌ๊ฑ€์ด ๋ถ€ํ™”๋˜๋Š” ํšŸ์ˆ˜, ์ฝ”๋ผ๋ฆฌ์˜ ์ƒ์žฅ ๋“ฑ์ด ํ”ผ๋ณด๋‚˜์น˜ ์ˆ˜์—ด์„ ๋”ฐ๋ฅด๊ธฐ ๋•Œ๋ฌธ์ž…๋‹ˆ๋‹ค. ๐ŸŒฑ๐Ÿฆ†๐Ÿฎ
85
+
86
+ ์ง€๊ธˆ๋ถ€ํ„ฐ๋Š” ํŒŒ์ด์ฌ ์ฝ”๋“œ๋ฅผ ์ž‘์„ฑํ•ด ๋ณผ๊นŒ์š”? ๐Ÿ˜Š
87
+
88
+ ๋จผ์ €, ํŒŒ์ด์ฌ ์ฝ”๋“œ๋ฅผ ์ž‘์„ฑํ•˜๊ธฐ ์œ„ํ•ด ํ•„์š”ํ•œ ๋ชจ๋“ˆ์€ ์—†์Šต๋‹ˆ๋‹ค. ์ €ํฌ๋Š” ํ”ผ๋ณด๋‚˜์น˜ ์ˆ˜์—ด์„ ์ƒ์„ฑํ•˜๋Š” ์•Œ๊ณ ๋ฆฌ์ฆ˜์„ ์ž‘์„ฑํ•  ๊ฒƒ์ž…๋‹ˆ๋‹ค.
89
+
90
+ 1. ํŒŒ์ด์ฌ ์ฝ”๋“œ ์ƒ์„ฑ
91
+ ๋‹ค์Œ์€ ํ”ผ๋ณด๋‚˜์น˜ ์ˆ˜์—ด์„ ์ƒ์„ฑํ•˜๋Š” ์ฝ”๋“œ์ž…๋‹ˆ๋‹ค. ์ด ์ฝ”๋“œ๋Š” `while` ๋ฃจํ”„๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ํ”ผ๋ณด๋‚˜์น˜ ์ˆ˜์—ด์„ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.
92
+
93
+ ```python
94
+ def fib(n):
95
+ if n <= 1:
96
+ return n
97
+ a, b = 0, 1
98
+ for _ in range(2, n+1):
99
+ a, b = b, a + b
100
+ return b
101
+
102
+ n = int(input("ํ”ผ๋ณด๋‚˜์น˜ ์ˆ˜์—ด์„ ์–ผ๋งˆ๋‚˜ ์ƒ์„ฑํ• ์ง€ ์ž…๋ ฅํ•˜์„ธ์š”: "))
103
+ for i in range(n):
104
+ print(fib(i+1))
105
+ ```
106
+ 2. ์ฝ”๋“œ ์„ค๋ช…
107
+ ์œ„ ์ฝ”๋“œ๋Š” `fib(n)` ํ•จ์ˆ˜๋ฅผ ์ •์˜ํ•ฉ๋‹ˆ๋‹ค. ์ด ํ•จ์ˆ˜๋Š” `n`๋ฒˆ์งธ ํ”ผ๋ณด๋‚˜์น˜ ์ˆ˜๋ฅผ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค.
108
+
109
+ `fib(n)` ํ•จ์ˆ˜๋Š” `if` ์กฐ๊ฑด๋ฌธ์„ ์‚ฌ์šฉํ•˜์—ฌ `n`์ด 0 ๋˜๋Š” 1์ผ ๊ฒฝ์šฐ ํ•ด๋‹น ๊ฐ’์€ ์ฆ‰์‹œ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค.
110
+
111
+ `a, b = 0, 1`์€ ํ”ผ๋ณด๋‚˜์น˜ ์ˆ˜์—ด์˜ ์ดˆ๊ธฐ ๊ฐ’์„ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค. `a`๋Š” `0`์„, `b`๋Š” `1`์„ ํ• ๋‹นํ•ฉ๋‹ˆ๋‹ค.
112
+
113
+ `for` ๋ฃจํ”„๋Š” `range(2, n+1)`์—์„œ ์ƒ์„ฑ๋˜๋Š” ๋ฐ˜๋ณต์„ ์ˆ˜ํ–‰ํ•ฉ๋‹ˆ๋‹ค. ์ด ๋ฐ˜๋ณต์€ `a, b = b, a + b`๋ฅผ ์ˆ˜ํ–‰ํ•˜์—ฌ ํ”ผ๋ณด๋‚˜์น˜ ์ˆ˜์—ด์„ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.
114
+
115
+ `print(fib(i+1))`๋Š” `fib(n)` ํ•จ์ˆ˜ ํ˜ธ์ถœ ๊ฒฐ๊ณผ๋ฅผ ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค.
116
+
117
+ 3. ์ฝ”๋“œ ์‹คํ–‰
118
+ ์œ„ ์ฝ”๋“œ๋ฅผ ์‹คํ–‰ํ•˜๊ธฐ ์œ„ํ•ด ํŒŒ์ด์ฌ ์ธํ„ฐํ”„๋ ˆํ„ฐ์—์„œ ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์‹คํ–‰ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
119
+ ```python
120
+ $ python fib.py
121
+ ํ”ผ๋ณด๋‚˜์น˜ ์ˆ˜์—ด์„ ์–ผ๋งˆ๋‚˜ ์ƒ์„ฑํ• ์ง€ ์ž…๋ ฅํ•˜์„ธ์š”: 10
122
+ 1
123
+ 1
124
+ 2
125
+ 3
126
+ 5
127
+ 8
128
+ 13
129
+ 21
130
+ 34
131
+ 55
132
+ ```
133
+ ์œ„ ์ฝ”๋“œ๋ฅผ ์‹คํ–‰ํ•˜๋ฉด, ์‚ฌ์šฉ์ž๋Š” `ํ”ผ๋ณด๋‚˜์น˜ ์ˆ˜์—ด์„ ์–ผ๋งˆ๋‚˜ ์ƒ์„ฑํ• ์ง€ ์ž…๋ ฅํ•˜์„ธ์š”:`๋ฅผ ์ž…๋ ฅํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด ์ž…๋ ฅ์€ `n`์— ํ• ๋‹น๋ฉ๋‹ˆ๋‹ค. `n`์€ ์ฝ”๋“œ๊ฐ€ ํ”ผ๋ณด๋‚˜์น˜ ์ˆ˜์—ด์„ ์ƒ์„ฑํ•˜๋Š” ํšŸ์ˆ˜๋ฅผ ๊ฒฐ์ •ํ•˜๋Š” ๋ณ€์ˆ˜์ž…๋‹ˆ๋‹ค. ์‚ฌ์šฉ์ž๋Š” ์ด ํšŸ์ˆ˜๋ฅผ ์ž…๋ ฅํ•˜์—ฌ ํ”ผ๋ณด๋‚˜์น˜ ์ˆ˜์—ด์„ ์ƒ์„ฑํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
134
+
135
+ ์ด์ƒ ํŒŒ์ด์ฌ ์ฝ”๋“œ๋ฅผ ์ž‘์„ฑํ•˜๊ณ  ์‹คํ–‰ํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ์„ค๋ช…ํ–ˆ์Šต๋‹ˆ๋‹ค. ๐Ÿ˜Š
136
+
137
+ ### More samples
138
+
139
+ > I used same system prompt, but you could change on your own.
140
+
141
+ ```python
142
+ messages = [
143
+ {"role": "system", "content": "์นœ์ ˆํ•œ ์ฑ—๋ด‡์œผ๋กœ์„œ ์ƒ๋Œ€๋ฐฉ์˜ ์š”์ฒญ์— ์ตœ๋Œ€ํ•œ ์ž์„ธํ•˜๊ณ  ์นœ์ ˆํ•˜๊ฒŒ ๋‹ตํ•˜์ž. ๋ชจ๋“  ๋Œ€๋‹ต์€ ํ•œ๊ตญ์–ด(Korean)์œผ๋กœ ๋Œ€๋‹ตํ•ด์ค˜."},
144
+ {"role": "user", "content": "ํ•œ๊ตญ์˜ ์ œํ—Œ ํ—Œ๋ฒ•์— ๋Œ€ํ•ด์„œ ์ž์„ธํžˆ ์„ค๋ช…ํ•ด์ฃผ์„ธ์š”."},
145
+ ]
146
+ ---
147
+ ๋Œ€ํ•œ๋ฏผ๊ตญ ํ—Œ๋ฒ•์€ 1948๋…„ 7์›” 17์ผ ์ œ์ •๋œ ์ด๋ž˜ ํ˜„์žฌ๊นŒ์ง€ ๋Œ€ํ•œ๋ฏผ๊ตญ์˜ ๊ธฐ๋ณธ๋ฒ•์ธ ๊ตญ๊ฐ€์˜ ๊ธฐ๋ณธ์งˆ์„œ์™€ ๊ตญ๊ฐ€๊ธฐ๊ด€์˜ ๊ถŒํ•œ, ๊ตญ๋ฏผ์˜ ๊ถŒ๋ฆฌยท์˜๋ฌด, ํ†ต์น˜์กฐ์ง, ํ†ต์น˜๋ฐฉ๋ฒ• ๋“ฑ์„ ๊ทœ์ •ํ•˜๋Š” ๋ฒ•๋ฅ ์ž…๋‹ˆ๋‹ค. ํ—Œ๋ฒ•์€ ๋Œ€ํ•œ๋ฏผ๊ตญ์˜ ์ตœ๊ณ ๋ฒ•๋ น์œผ๋กœ, ์ผ๋ฐ˜๋ฒ•์ƒ ๋ชจ๋“  ๋ฒ•๋ฅ ์˜ ๊ทผ๊ฑฐ๊ฐ€ ๋ฉ๋‹ˆ๋‹ค. ๋˜ํ•œ ํ—Œ๋ฒ•์€ 1987๋…„ ์ œ์ •๋œ ์ œ6๊ณตํ™”๊ตญ ํ—Œ๋ฒ•๋ถ€ํ„ฐ๋Š” '๋ฏผ์ฃผ๊ณตํ™”๊ตญ'์„ ๊ธฐ๋ณธ์งˆ์„œ๋กœ ๊ทœ์ •ํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.
148
+
149
+ ** ์ฃผ์š” ๋‚ด์šฉ **
150
+
151
+ 1. ๊ธฐ๋ณธ์งˆ์„œ : ๋ฏผ์ฃผ๊ณตํ™”๊ตญ, ํ†ต์ผ์กฐ๊ตญ์˜ ์›์น™, ์ธ๊ถŒ์˜ ๋ณด์žฅ
152
+ 2. ๊ตญ๋ฏผ์˜ ๊ถŒ๋ฆฌ : ์‹ ์ฒด์˜ ์ž์œ , ๊ธฐ๋ณธ์  ์ธ๊ถŒ, ์žฌ์‚ฐ๊ถŒ, ์ฐธ์ •๊ถŒ
153
+ 3. ๊ตญ๊ฐ€๊ธฐ๊ด€ : ๋Œ€ํ†ต๋ น, ๊ตญ๋ฌด์ด๋ฆฌ, ๊ตญํšŒ, ๋Œ€๋ฒ•์›, ํ—Œ๋ฒ•์žฌํŒ์†Œ, ๊ฒ€์ฐฐ
154
+ 4. ํ†ต์น˜์กฐ์ง : ํ–‰์ •๋ถ€, ์ž…๋ฒ•๋ถ€, ์‚ฌ๋ฒ•๋ถ€์˜ ๋ถ„๋ฆฌ
155
+ 5. ํ†ต์น˜๋ฐฉ๋ฒ• : ๋ฏผ์ฃผ์ฃผ์˜(๊ตญ๋ฏผ์˜ ์ฃผ๊ถŒ์— ์˜ํ•˜์—ฌ ๊ตญ๋ฏผ์œผ๋กœ๋ถ€ํ„ฐ ์œ„์ž„๋ฐ›์€ ๊ถŒ๋ ฅ ํ–‰์‚ฌ), ๋ฒ•์น˜์ฃผ์˜(๋ฒ•๋ฅ ์— ์˜ํ•˜์—ฌ ํ†ต์น˜)
156
+
157
+ ** ์ฃผ์š” ์กฐํ•ญ **
158
+
159
+ 1. ์ œ1์กฐ : ๋Œ€ํ•œ๋ฏผ๊ตญ์€ ๋ฏผ์ฃผ๊ณตํ™”๊ตญ์ž„์„ ์ฒœ๋ช…
160
+ 2. ์ œ2์กฐ : ๋ฏผ์ฃผ๊ณตํ™”๊ตญ์˜ ์ฃผ๊ถŒ์€ ๊ตญ๋ฏผ์—๊ฒŒ ์žˆ์œผ๋ฉฐ, ๋ชจ๋“  ๊ถŒ๋ ฅ์€ ๊ตญ๋ฏผ์œผ๋กœ๋ถ€ํ„ฐ ๋‚˜์˜จ๋‹ค
161
+ 3. ์ œ10์กฐ : ๋ชจ๋“  ๊ตญ๋ฏผ์€ ํ–‰๋ณต์„ ์ถ”๊ตฌํ•  ๊ถŒ๋ฆฌ๋ฅผ ๊ฐ€์ง„๋‹ค
162
+ 4. ์ œ13์กฐ : ๋ชจ๋“  ๊ตญ๋ฏผ์€ ์ฃผ๊ฑฐ์˜ ์ž์œ ๋ฅผ ๊ฐ–๋Š”๋‹ค
163
+ 5. ์ œ25์กฐ : ๊ตญ๊ฐ€๋Š” ์žฌํ•ด๋ฅผ ๋ฐฉ์ง€ํ•˜๊ณ  ๊ทธ์— ๋Œ€์ฒ˜ํ•˜๋Š” ์‹œ์ฑ…์„ ์‹œํ–‰ํ•˜์—ฌ์•ผ ํ•œ๋‹ค
164
+ 6. ์ œ64์กฐ : ๋Œ€ํ†ต๋ น์€ ๋ฒ•๋ฅ ์„ ๊ณตํฌํ•˜๊ณ , ๊ตญ๋ฌด์ด๋ฆฌ์™€ ๊ตญ๋ฌด์œ„์›์„ ์ž„๋ช…ํ•œ๋‹ค
165
+ 7. ์ œ111์กฐ : ๋Œ€๋ฒ•์›์€ ์ตœ์ข…์ ์ธ ๋ฒ•๋ฅ ์‹ฌํŒ์„ ํ–‰ํ•˜๊ณ , ํ—Œ๋ฒ•์žฌํŒ์†Œ๋Š” ํ—Œ๋ฒ•์— ์œ„๋ฐ˜๋˜๋Š”์ง€ ์—ฌ๋ถ€๋ฅผ ๊ฒฐ์ •
166
+
167
+ ** ํ—Œ๋ฒ•์˜ ํšจ๋ ฅ **
168
+
169
+ ํ—Œ๋ฒ•์€ ๋Œ€ํ•œ๋ฏผ๊ตญ์˜ ๊ธฐ๋ณธ๋ฒ•๋ฅ ์ด๋ฏ€๋กœ ๋ชจ๋“  ๊ตญ๋ฏผ์€ ํ—Œ๋ฒ•์— ๋”ฐ๋ผ์•ผ ํ•ฉ๋‹ˆ๋‹ค. ๋˜ํ•œ ํ—Œ๋ฒ•์€ ๋ณ€๊ฒฝํ•˜๋ ค๋ฉด ํ—Œ๋ฒ•๊ฐœ์ •์•ˆ์„ ์ œ์•ˆํ•˜๊ณ , ์ด๋ฅผ ๊ตญ๋ฏผํˆฌํ‘œ์— ๋ถ™์—ฌ์•ผ ํ•˜๋ฉฐ, ์ด๋ฅผ ํ†ต๊ณผํ•˜๋ฉด ์ƒˆ ํ—Œ๋ฒ•์„ ์ œ์ •ํ•˜๊ฒŒ ๋ฉ๋‹ˆ๋‹ค. (์ œ130์กฐ)
170
+
171
+ ์ด์ƒ, ๋Œ€ํ•œ๋ฏผ๊ตญ ํ—Œ๋ฒ•์˜ ์ฃผ์š” ๋‚ด์šฉ๊ณผ ์กฐํ•ญ, ํšจ๋ ฅ์„ ์„ค๋ช…ํ•˜์˜€์Šต๋‹ˆ๋‹ค. ํ•œ๊ตญ ํ—Œ๋ฒ•์€ ๋ฏผ์ฃผ๊ณตํ™”๊ตญ์˜ ๊ธฐ๋ณธ์งˆ์„œ๋ฅผ ์ค‘์‹œํ•˜๊ณ , ๊ธฐ๋ณธ๊ถŒ์„ ๋ณดํ˜ธํ•  ๋ฟ๋งŒ ์•„๋‹ˆ๋ผ, ํ†ต์น˜์กฐ์ง์˜ ๋ถ„๋ฆฌ, ๋ฒ•์น˜์ฃผ์˜, ๋ฏผ์ฃผ์ฃผ์˜๋ฅผ ๊ทผ๊ฐ„์œผ๋กœ ํ•ฉ๋‹ˆ๋‹ค. ๐Ÿ‡ฐ๐Ÿ‡ท
172
+ ```
173
+
174
+ ```python
175
+ messages = [
176
+ {"role": "system", "content": "์นœ์ ˆํ•œ ์ฑ—๋ด‡์œผ๋กœ์„œ ์ƒ๋Œ€๋ฐฉ์˜ ์š”์ฒญ์— ์ตœ๋Œ€ํ•œ ์ž์„ธํ•˜๊ณ  ์นœ์ ˆํ•˜๊ฒŒ ๋‹ตํ•˜์ž. ๋ชจ๋“  ๋Œ€๋‹ต์€ ํ•œ๊ตญ์–ด(Korean)์œผ๋กœ ๋Œ€๋‹ตํ•ด์ค˜."},
177
+ {"role": "user", "content": "์ด์ˆœ์‹  ์žฅ๊ตฐ์— ๋Œ€ํ•ด ์„ค๋ช…ํ•ด์ค˜."},
178
+ ]
179
+ ---
180
+ ์ด์ˆœ์‹  ์žฅ๊ตฐ์€ ์กฐ์„ ์˜ ๋ฌธ์‹ , ๋ฌด์‹ , ํ•ด๊ตฐ์˜ ์˜์›…์œผ๋กœ 1592๋…„๋ถ€ํ„ฐ 1598๋…„๊นŒ์ง€ ์ž„์ง„์™œ๋ž€๊ณผ ์ •์œ ์žฌ๋ž€ ๋™์•ˆ ํ•ด๊ตฐ์œผ๋กœ์„œ ํ™œ์•ฝํ–ˆ์Šต๋‹ˆ๋‹ค. ๊ทธ๋Š” 1591๋…„ ์ „๋ผ์ขŒ๋„ ์ˆ˜๊ตฐ์ ˆ๋„์‚ฌ๊ฐ€ ๋˜์–ด ์„ ์ œ๊ณต๊ฒฉ ์ „ํ†ต์„ ์ด์–ด๋ฐ›์€ ๋ฐ”, '์‹ ์†์„ฑ'๊ณผ '์‹ ์šฉ', '๋„ํƒ„์ „' ๋“ฑ์˜ ๋ณ‘๋ฒ•์„ ๋„์ž…ํ•˜์—ฌ ์กฐ์„  ์ˆ˜๊ตฐ์„ ๊ฐœํŽธํ–ˆ์Šต๋‹ˆ๋‹ค. ์ด์ˆœ์‹  ์žฅ๊ตฐ์˜ ๊ฐ€์žฅ ํฐ ์—…์ ์œผ๋กœ๋Š” ๋‘ ๊ฐ€์ง€๋ฅผ ๊ผฝ์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ฒซ ๋ฒˆ์งธ๋Š” 'ํ•œ์‚ฐ๋„ ๋Œ€์ฒฉ'์ž…๋‹ˆ๋‹ค. 1592๋…„ 7์›” 8์ผ, ์ด์ˆœ์‹  ์žฅ๊ตฐ์€ ์ด๋„๋Š” ์กฐ์„  ์ˆ˜๊ตฐ 13์ฒ™์ด ์™œ๊ตฐ 133์ฒ™์— ๋งž์„œ 13์ฒ™์˜ ๋ฐฐ๋กœ๋Š” ๋ถˆ๊ฐ€๋Šฅํ•œ ์ „์Ÿ์„ ๋ฒŒ์ด๊ฒŒ ๋ฉ๋‹ˆ๋‹ค. ์ด๋•Œ ์ด์ˆœ์‹  ์žฅ๊ตฐ์€ '์ง„ํ‡ด์œ ๊ณก'์˜ ์ „์ˆ ์„ ์‚ฌ์šฉํ•˜์—ฌ 13์ฒ™์˜ ๋ฐฐ๋ฅผ 133์ฒ™์˜ ๋ฐฐ์™€ ์‹ธ์›Œ ์Šน๋ฆฌ๋ฅผ ๊ฑฐ๋‘์—ˆ์Šต๋‹ˆ๋‹ค. ๋‘ ๋ฒˆ์งธ๋Š” '๋…ธ๋Ÿ‰ํ•ด์ „'์ž…๋‹ˆ๋‹ค. 1598๋…„ 11์›” 14์ผ, ์ด์ˆœ์‹  ์žฅ๊ตฐ์€ ๋…ธ๋Ÿ‰์—์„œ 12์ฒ™์˜ ๋ฐฐ๋กœ 330์ฒ™์˜ ๋ฐฐ๋ฅผ ์ด๋„๋Š” ์™€ํ‚ค์ž์นด ์•ผ์Šคํ•˜๋ฃจ์™€ ์‹ธ์šฐ๊ฒŒ ๋ฉ๋‹ˆ๋‹ค. ์ด๋•Œ ์ด์ˆœ์‹  ์žฅ๊ตฐ์˜ ๋ฐฐ์— ๋ช…์ค‘๋œ ์ด์•Œ์ด 1๋ฐœ์ด์—ˆ๊ณ , 12์ฒ™์˜ ๋ฐฐ๊ฐ€ ๊ณ ์ „์„ ๋ฉด์น˜ ๋ชปํ–ˆ์ง€๋งŒ, ์ด์ˆœ์‹  ์žฅ๊ตฐ์€ ๋๊นŒ์ง€ ์‹ธ์›Œ 2๋ช…์„ ์ œ์™ธํ•˜๊ณ ๋Š” ์ „์› ์ „์‚ฌํ•˜๊ฒŒ ๋ฉ๋‹ˆ๋‹ค. ์ด์ˆœ์‹  ์žฅ๊ตฐ์˜ ์ „ํˆฌ๋ฅผ ๋น„๋กฏํ•˜์—ฌ ๊ทธ์˜ ์—…์ ์€ ์กฐ์„  ์ˆ˜๊ตฐ์˜ ์ „ํˆฌ ์Šน๋ฆฌ๋ฅผ ์ด๋Œ์—ˆ์œผ๋ฉฐ, ๊ทธ์˜ ์ด๋ฆ„์€ ํ•œ๊ตญ์˜ ๊ตญ๋ณด ์ œ76ํ˜ธ๋กœ ๋“ฑ์žฌ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค. ์ด์ˆœ์‹  ์žฅ๊ตฐ์˜ ์—…์ ๊ณผ ์ •์‹ ์€ ํ•œ๊ตญ ์—ญ์‚ฌ์™€ ๋ฌธํ™”์— ์ง€๋Œ€ํ•œ ์˜ํ–ฅ์„ ๋ผ์ณค์Šต๋‹ˆ๋‹ค.
181
+ ```
182
+
183
+ ```python
184
+ messages = [
185
+ {"role": "system", "content": "์นœ์ ˆํ•œ ์ฑ—๋ด‡์œผ๋กœ์„œ ์ƒ๋Œ€๋ฐฉ์˜ ์š”์ฒญ์— ์ตœ๋Œ€ํ•œ ์ž์„ธํ•˜๊ณ  ์นœ์ ˆํ•˜๊ฒŒ ๋‹ตํ•˜์ž. ๋ชจ๋“  ๋Œ€๋‹ต์€ ํ•œ๊ตญ์–ด(Korean)์œผ๋กœ ๋Œ€๋‹ตํ•ด์ค˜."},
186
+ {"role": "user", "content": "๋…๋„์™€ ๋‹ค์ผ€์‹œ๋งˆ์˜ ์ฐจ์ด๊ฐ€ ๋ญ์•ผ?"},
187
+ ]
188
+ ---
189
+ ! `ํ•œ๊ตญ์˜ ๊ณ ์œ ์˜ํ† `์™€ `์ผ๋ณธ์˜ ์˜์œ ๊ถŒ ๊ณผ์žฅ` ์ฐจ์ด! ๐ŸŒŠ
190
+
191
+ ์ผ๋ณธ์ด ์ฃผ์žฅํ•˜๋Š” `๋‹ค์ผ€์‹œ๋งˆ(็ซนๅณถ)`๋Š”, ์‹ค์ œ๋กœ๋Š” '์šธ๋ฆ‰๋„' ์„œ์ชฝ ์•ฝ 87km ์ง€์ ์— ์žˆ๋Š” '๋…๋„(็จๅณถ)'๋ฅผ ๊ฐ€๋ฆฌํ‚ต๋‹ˆ๋‹ค. ํ•œ๊ตญ์ด ์—ญ์‚ฌ์ ์œผ๋กœ๋ถ€ํ„ฐ ์ง€๋ฐฐํ•˜๊ณ  ๊ด€๋ฆฌํ•ด์˜จ ๊ฒƒ์€ ๋ฌผ๋ก , ์œ ๋„ค์Šค์ฝ” ์„ธ๊ณ„์œ ์‚ฐ์œผ๋กœ ๋“ฑ์žฌ๋œ `๋Œ€ํ•œ๋ฏผ๊ตญ์˜ ์˜ํ† `์ด์ง€์š”. ๐Ÿ˜Ž
192
+
193
+ ํ•œํŽธ, ๋…๋„๋Š” ํ•œ๊ตญ์˜ ๊ณ ์œ  ๏ฟฝ๏ฟฝ๏ฟฝ๋ฆ„์œผ๋กœ, `์šธ๋ฆ‰๋„`์™€ ํ•จ๊ป˜ `์‚ผ๊ตญ์‚ฌ๊ธฐ`์— ์ฒ˜์Œ ๊ธฐ์žฌ๋œ `๋Œ€ํ•œ๋ฏผ๊ตญ์˜ ๊ณ ์œ  ์„ฌ`์ž…๋‹ˆ๋‹ค. 1886๋…„ ์ผ๋ณธ์ด '๋‹ค์ผ€์‹œ๋งˆ'๋ผ๊ณ  ๋ช…๋ช…ํ•œ ์ด๋ž˜, ๊ณต์‹์ ์œผ๋กœ `์ผ๋ณธ ๊ณ ์œ  ์„ฌ`์œผ๋กœ ์ฃผ์žฅํ•˜๊ณ  ์žˆ์ง€๋งŒ, ์ด๋Š” `์—ญ์‚ฌ ์™œ๊ณก`์ž…๋‹ˆ๋‹ค! โš ๏ธ
194
+
195
+ ๋”ฐ๋ผ์„œ, ์„ธ๊ณ„์ ์œผ๋กœ ์ธ์ •๋ฐ›๋Š” ๊ตญ๊ฐ€์˜ `์˜ํ† `๋Š” ํ•œ๊ตญ์˜ `๋…๋„`๊ฐ€ ๋งž๋Š” ๊ฒƒ์ด์ง€์š”! ๐Ÿ”ฅ `์šธ๋ฆ‰๋„`๋„ `๋…๋„`๋„ ํ•œ๊ตญ์˜ ๊ณ ์œ  ์˜ํ† ์— ์†ํ•œ ์„ฌ๋“ค์ด๋ž๋‹ˆ๋‹ค! ๐Ÿ’•
196
+
197
+ ํ˜น์‹œ ๋” ๊ถ๊ธˆํ•œ ์‚ฌ์‹ค์ด ์žˆ์œผ๋ฉด ๋ง์”€ํ•ด์ฃผ์„ธ์š”! ๐Ÿค”
198
+ ```
199
+
200
+ ```python
201
+ messages = [
202
+ {"role": "system", "content": "์นœ์ ˆํ•œ ์ฑ—๋ด‡์œผ๋กœ์„œ ์ƒ๋Œ€๋ฐฉ์˜ ์š”์ฒญ์— ์ตœ๋Œ€ํ•œ ์ž์„ธํ•˜๊ณ  ์นœ์ ˆํ•˜๊ฒŒ ๋‹ตํ•˜์ž. ๋ชจ๋“  ๋Œ€๋‹ต์€ ํ•œ๊ตญ์–ด(Korean)์œผ๋กœ ๋Œ€๋‹ตํ•ด์ค˜."},
203
+ {"role": "user", "content": "์„ธ์ข…๋Œ€์™•์˜ ์ง‘ํ˜„์ „ ๋งฅ๋ถ ๋˜์ง ์‚ฌ๊ฑด์— ๋Œ€ํ•ด์„œ ์•Œ๊ณ  ์žˆ์–ด?"},
204
+ ]
205
+ ---
206
+ ์•„์ฃผ ํฅ๋ฏธ๋กœ์šด ์‚ฌ๊ฑด์ž…๋‹ˆ๋‹ค. ์„ธ์ข…๋Œ€์™•์ด ์ง‘ํ˜„์ „์—์„œ ๋งฅ๋ถ์„ ๋˜์กŒ๋‹ค๋Š” ์ด์•ผ๊ธฐ๋Š” ์—†์Šต๋‹ˆ๋‹ค. ์‹ค์ œ๋กœ ์„ธ์ข…๋Œ€์™•์€ 1418๋…„ 1์›” 9์ผ ์ง‘ํ˜„์ „์—์„œ 26๋ช…์˜ ๋ฌธ์‹ ๊ณผ ํ•จ๊ป˜ ์ƒˆ๋กœ์šด ํ›ˆ๋ฏผ์ •์Œ ๋ฐ˜ํฌ๋ฅผ ์œ„ํ•ด ๊ฐ„์ž์ฒด์˜ ๊ธ€์”จ๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ์„ ๋ฐ˜๋Œ€ํ•œ ํ™์œค์„ฑ ๋“ฑ์˜ ๋ฌด๋ฆฌ์™€์˜ ๋…ผ์Ÿ์„ ๋ฒŒ์˜€์Šต๋‹ˆ๋‹ค. ๋‹น์‹œ ์„ธ์ข…๋Œ€์™•์€ ์ด๋“ค์˜ ์ฃผ์žฅ์„ ๋‹จํ˜ธํžˆ ๊ฑฐ๋ถ€ํ–ˆ์Šต๋‹ˆ๋‹ค. ์ด ์‚ฌ๊ฑด์€ '์ง‘ํ˜„์ „ ๋…ผ๋ฐ• ์‚ฌ๊ฑด'์œผ๋กœ ์•Œ๋ ค์ ธ ์žˆ์Šต๋‹ˆ๋‹ค. ๋งฅ๋ถ๊ณผ ๊ด€๋ จ๋œ ์ผ์ด ์•„๋‹ˆ๋ผ๋Š” ๊ฒƒ์ด์ฃ . ๋งฅ๋ถ์€ 2006๋…„ ์• ํ”Œ์ด ์ถœ์‹œํ•œ ๋…ธํŠธ๋ถ์˜ ๋ธŒ๋žœ๋“œ๋ช…์ž…๋‹ˆ๋‹ค. ์„ธ์ข…๋Œ€์™•์ด ์‚ด์•˜๋˜ ์‹œ๊ธฐ๋Š” 1418๋…„์—์„œ 1450๋…„๊นŒ์ง€์ž…๋‹ˆ๋‹ค. ๋งฅ๋ถ์€ ํ›จ์”ฌ ๋’ค์˜ ์ผ์ž…๋‹ˆ๋‹ค. ๐Ÿ˜…
207
+ ```
208
+
209
+ ```python
210
+ messages = [
211
+ {"role": "system", "content": "์นœ์ ˆํ•œ ์ฑ—๋ด‡์œผ๋กœ์„œ ์ƒ๋Œ€๋ฐฉ์˜ ์š”์ฒญ์— ์ตœ๋Œ€ํ•œ ์ž์„ธํ•˜๊ณ  ์นœ์ ˆํ•˜๊ฒŒ ๋‹ตํ•˜์ž. ๋ชจ๋“  ๋Œ€๋‹ต์€ ํ•œ๊ตญ์–ด(Korean)์œผ๋กœ ๋Œ€๋‹ตํ•ด์ค˜."},
212
+ {"role": "user", "content": "๋‚˜๋Š” ์˜ค๋Š˜ ์‚ฌ๊ณผ 5๊ฐœ๋ฅผ ๊ฐ–๊ณ ์žˆ์–ด. ๊ทธ๋ฆฌ๊ณ  ์–ด์ œ ๋‚˜๋Š” ์‚ฌ๊ณผ 2๊ฐœ๋ฅผ ๋จน์—ˆ์ง€. ๋‚ด๊ฐ€ ์ง€๊ธˆ ๊ฐ€์ง„ ์‚ฌ๊ณผ๋Š” ๋ช‡ ๊ฐœ์ง€?"},
213
+ ]
214
+ ---
215
+ ๐Ÿ‘€ ๋‹น์‹ ์€ ์˜ค๋Š˜ 5๊ฐœ์˜ ์‚ฌ๊ณผ๋ฅผ ๊ฐ–๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  ์–ด์ œ 2๊ฐœ๋ฅผ ๋จน์—ˆ๋‹ค๊ณ  ํ•˜์…จ์œผ๋‹ˆ, ์˜ค๋Š˜ ํ˜„์žฌ ๋‹น์‹ ์ด ๊ฐ–๊ณ  ์žˆ๋Š” ์‚ฌ๊ณผ๋Š” 5๊ฐœ์—์„œ 2๊ฐœ๋ฅผ ๋บ€ 3๊ฐœ์ž…๋‹ˆ๋‹ค! ๐Ÿ˜Š
216
+ ```
217
+