Update README.md
Browse files
README.md
CHANGED
@@ -1,32 +1,213 @@
|
|
1 |
---
|
|
|
2 |
library_name: peft
|
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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
+
license: apache-2.0
|
3 |
library_name: peft
|
4 |
---
|
5 |
+
|
6 |
+
# Food Order Understanding in Korean
|
7 |
+
|
8 |
+
This is a LoRA adapter as a result of fine-tuning the pre-trained model `meta-llama/Llama-2-7b-chat-hf`. It is designed with the expectation of understanding Korean food ordering sentences, and analyzing food menus, option names, and quantities.
|
9 |
+
|
10 |
+
## Usage
|
11 |
+
|
12 |
+
Here is an example of loading the model.
|
13 |
+
Note the pretrained model is `meta-llama/Llama-2-7b-chat-hf`.
|
14 |
+
|
15 |
+
```python
|
16 |
+
peft_model_id = "jangmin/qlora-llama2-7b-chat-hf-food-order-understanding-30K"
|
17 |
+
|
18 |
+
config = PeftConfig.from_pretrained(peft_model_id)
|
19 |
+
|
20 |
+
bnb_config = BitsAndBytesConfig(
|
21 |
+
load_in_4bit=True,
|
22 |
+
bnb_4bit_use_double_quant=True,
|
23 |
+
bnb_4bit_quant_type="nf4",
|
24 |
+
bnb_4bit_compute_dtype=torch.bfloat16
|
25 |
+
)
|
26 |
+
model = AutoModelForCausalLM.from_pretrained(config.base_model_name_or_path, quantization_config=bnb_config, cache_dir=cache_dir, device_map={"":0})
|
27 |
+
model = PeftModel.from_pretrained(model, peft_model_id)
|
28 |
+
tokenizer = AutoTokenizer.from_pretrained(config.base_model_name_or_path, cache_dir=cache_dir)
|
29 |
+
|
30 |
+
model.eval()
|
31 |
+
```
|
32 |
+
|
33 |
+
Inferece can be done as follows.
|
34 |
+
```python
|
35 |
+
instruction_prompt_template = """
|
36 |
+
๋ค์์ ๋งค์ฅ์์ ๊ณ ๊ฐ์ด ์์์ ์ฃผ๋ฌธํ๋ ์ฃผ๋ฌธ ๋ฌธ์ฅ์ด๋ค. ์ด๋ฅผ ๋ถ์ํ์ฌ ์์๋ช
, ์ต์
, ์๋์ ์ถ์ถํ์ฌ ๊ณ ๊ฐ์ ์๋๋ฅผ ์ดํดํ๊ณ ์ ํ๋ค.
|
37 |
+
๋ถ์ ๊ฒฐ๊ณผ๋ฅผ ์์ฑํด์ฃผ๊ธฐ ๋ฐ๋๋ค.
|
38 |
+
|
39 |
+
### ์ฃผ๋ฌธ ๋ฌธ์ฅ: {0} ### ๋ถ์ ๊ฒฐ๊ณผ:
|
40 |
+
"""
|
41 |
+
def gen(x):
|
42 |
+
q = instruction_prompt_template.format(x)
|
43 |
+
gened = model.generate(
|
44 |
+
**tokenizer(
|
45 |
+
q,
|
46 |
+
return_tensors='pt',
|
47 |
+
return_token_type_ids=False
|
48 |
+
).to('cuda'),
|
49 |
+
max_new_tokens=256,
|
50 |
+
early_stopping=True,
|
51 |
+
do_sample=True,
|
52 |
+
eos_token_id=tokenizer.eos_token_id
|
53 |
+
)
|
54 |
+
decoded_results = tokenizer.batch_decode(gened, skip_special_tokens=True)
|
55 |
+
return decoded_results[0]
|
56 |
+
```
|
57 |
+
|
58 |
+
A generated sample is as follows.
|
59 |
+
```python
|
60 |
+
print(gen("์์ด์ค์๋ฉ๋ฆฌ์นด๋
ธ ํจ์ฌ์ด์ฆ ํ์ ํ๊ณ ์. ๋ธ๊ธฐ์ค๋ฌด๋ ํ์ ์ฃผ์ธ์. ๋, ์ฝ๋๋ธ๋ฃจ๋ผ๋ผ ํ๋์."))
|
61 |
+
```
|
62 |
+
```
|
63 |
+
๋ค์์ ๋งค์ฅ์์ ๊ณ ๊ฐ์ด ์์์ ์ฃผ๋ฌธํ๋ ์ฃผ๋ฌธ ๋ฌธ์ฅ์ด๋ค. ์ด๋ฅผ ๋ถ์ํ์ฌ ์์๋ช
, ์ต์
๋ช
, ์๋์ ์ถ์ถํ์ฌ ๊ณ ๊ฐ์ ์๋๋ฅผ ์ดํดํ๊ณ ์ ํ๋ค.
|
64 |
+
๋ถ์ ๊ฒฐ๊ณผ๋ฅผ ์์ฑํด์ฃผ๊ธฐ ๋ฐ๋๋ค.
|
65 |
+
|
66 |
+
### ๋ช
๋ น: ์์ด์ค์๋ฉ๋ฆฌ์นด๋
ธ ํจ์ฌ์ด์ฆ ํ์ ํ๊ณ ์. ๋ธ๊ธฐ์ค๋ฌด๋ ํ์ ์ฃผ์ธ์. ๋, ์ฝ๋๋ธ๋ฃจ๋ผ๋ผ ํ๋์. ### ์๋ต:
|
67 |
+
- ๋ถ์ ๊ฒฐ๊ณผ 0: ์์๋ช
:์์ด์ค์๋ฉ๋ฆฌ์นด๋
ธ, ์ต์
:ํจ์ฌ์ด์ฆ, ์๋:ํ์
|
68 |
+
- ๋ถ์ ๊ฒฐ๊ณผ 1: ์์๋ช
:๋ธ๊ธฐ์ค๋ฌด๋, ์๋:ํ์
|
69 |
+
- ๋ถ์ ๊ฒฐ๊ณผ 2: ์์๋ช
:์ฝ๋๋ธ๋ฃจ๋ผ๋ผ, ์๋:ํ๋
|
70 |
+
``````
|
71 |
+
|
72 |
+
More examples are as follows.
|
73 |
+
```
|
74 |
+
๋ค์์ ๋งค์ฅ์์ ๊ณ ๊ฐ์ด ์์์ ์ฃผ๋ฌธํ๋ ์ฃผ๋ฌธ ๋ฌธ์ฅ์ด๋ค. ์ด๋ฅผ ๋ถ์ํ์ฌ ์์๋ช
, ์ต์
๋ช
, ์๋์ ์ถ์ถํ์ฌ ๊ณ ๊ฐ์ ์๋๋ฅผ ์ดํดํ๊ณ ์ ํ๋ค.
|
75 |
+
๋ถ์ ๊ฒฐ๊ณผ๋ฅผ ์์ฑํด์ฃผ๊ธฐ ๋ฐ๋๋ค.
|
76 |
+
|
77 |
+
### ๋ช
๋ น: ์ค๋์ ๋น๊ฐ์ค๋๊น ์ด๊ฑฐ ๋จน์. ์ผ์ ์งฌ๋ฝ ๊ณฑ๋ฐฐ๊ธฐ ํ๋ํ๊ตฌ์, ์ฌ์ฒ ํ์์ก ์ค์ง ํ๊ทธ๋ฆ ์ฃผ์ธ์. ### ์๋ต:
|
78 |
+
- ๋ถ์ ๊ฒฐ๊ณผ 0: ์์๋ช
:์ผ์ ์งฌ๋ฝ,์ต์
:๊ณฑ๋ฐฐ๊ธฐ,์๋:ํ๋
|
79 |
+
- ๋ถ์ ๊ฒฐ๊ณผ 1: ์์๋ช
:์ฌ์ฒ ํ์์ก,์ต์
:์ค์ง,์๋:ํ๊ทธ๋ฆ
|
80 |
+
|
81 |
+
๋ค์์ ๋งค์ฅ์์ ๊ณ ๊ฐ์ด ์์์ ์ฃผ๋ฌธํ๋ ์ฃผ๋ฌธ ๋ฌธ์ฅ์ด๋ค. ์ด๋ฅผ ๋ถ์ํ์ฌ ์์๋ช
, ์ต์
๋ช
, ์๋์ ์ถ์ถํ์ฌ ๊ณ ๊ฐ์ ์๋๋ฅผ ์ดํดํ๊ณ ์ ํ๋ค.
|
82 |
+
๋ถ์ ๊ฒฐ๊ณผ๋ฅผ ์์ฑํด์ฃผ๊ธฐ ๋ฐ๋๋ค.
|
83 |
+
|
84 |
+
### ๋ช
๋ น: ์ฐธ์ด์ฌ ํ๋ณ, ์ฝ์นด์ฝ๋ผ 1.5๋ฆฌํฐ ํ๋ณ, ํ
์ฌ๋ผ ํ๋ณ์ด์. ### ์๋ต:
|
85 |
+
- ๋ถ์ ๊ฒฐ๊ณผ 0: ์์๋ช
:์ฐธ์ด์ฌ, ์๋:ํ๋ณ
|
86 |
+
- ๋ถ์ ๊ฒฐ๊ณผ 1: ์์๋ช
:์ฝ์นด์ฝ๋ผ, ์ต์
:1.5๋ฆฌํฐ, ์๋:ํ๋ณ
|
87 |
+
- ๋ถ์ ๊ฒฐ๊ณผ 2: ์์๋ช
:ํ
์ฌ๋ผ, ์๋:ํ๋ณ
|
88 |
+
|
89 |
+
๋ค์์ ๋งค์ฅ์์ ๊ณ ๊ฐ์ด ์์์ ์ฃผ๋ฌธํ๋ ์ฃผ๋ฌธ ๋ฌธ์ฅ์ด๋ค. ์ด๋ฅผ ๋ถ์ํ์ฌ ์์๋ช
, ์ต์
๋ช
, ์๋์ ์ถ์ถํ์ฌ ๊ณ ๊ฐ์ ์๋๋ฅผ ์ดํดํ๊ณ ์ ํ๋ค.
|
90 |
+
๋ถ์ ๊ฒฐ๊ณผ๋ฅผ ์์ฑํด์ฃผ๊ธฐ ๋ฐ๋๋ค.
|
91 |
+
|
92 |
+
### ๋ช
๋ น: ๊ผฌ๋ง๋ฌด์นจ 1์ธ๋ถํ๊ณ ์, ๋ญ๋๋ฆฌํ ์ค์ ์ฃผ์ธ์. ๊ทธ๋ฆฌ๊ณ ์์ฃผ๋ ํ๋ณ ์ฃผ์ธ์. ### ์๋ต:
|
93 |
+
- ๋ถ์ ๊ฒฐ๊ณผ 0: ์์๋ช
:๊ผฌ๋ง๋ฌด์นจ,์๋:1์ธ๋ถ
|
94 |
+
- ๋ถ์ ๊ฒฐ๊ณผ 1: ์๏ฟฝ๏ฟฝ๏ฟฝ๋ช
:๋ญ๋๋ฆฌํ,์ต์
:์ค์
|
95 |
+
- ๋ถ์ ๊ฒฐ๊ณผ 2: ์์๋ช
:์์ฃผ,์๋:ํ๋ณ
|
96 |
+
|
97 |
+
๋ค์์ ๋งค์ฅ์์ ๊ณ ๊ฐ์ด ์์์ ์ฃผ๋ฌธํ๋ ์ฃผ๋ฌธ ๋ฌธ์ฅ์ด๋ค. ์ด๋ฅผ ๋ถ์ํ์ฌ ์์๋ช
, ์ต์
๋ช
, ์๋์ ์ถ์ถํ์ฌ ๊ณ ๊ฐ์ ์๋๋ฅผ ์ดํดํ๊ณ ์ ํ๋ค.
|
98 |
+
๋ถ์ ๊ฒฐ๊ณผ๋ฅผ ์์ฑํด์ฃผ๊ธฐ ๋ฐ๋๋ค.
|
99 |
+
|
100 |
+
### ๋ช
๋ น: ๊น์น์ฐ๊ฐ 3์ธ๋ถํ๊ณ ์, ๊ณ๋๋ง์ด ์ฃผ์ธ์. ### ์๋ต:
|
101 |
+
- ๋ถ์ ๊ฒฐ๊ณผ 0: ์์๋ช
:๊น์น์ฐ๊ฐ,์๋:3์ธ๋ถ
|
102 |
+
- ๋ถ์ ๊ฒฐ๊ณผ 1: ์์๋ช
:๊ณ๋๋ง์ด
|
103 |
+
|
104 |
+
๋ค์์ ๋งค์ฅ์์ ๊ณ ๊ฐ์ด ์์์ ์ฃผ๋ฌธํ๋ ์ฃผ๋ฌธ ๋ฌธ์ฅ์ด๋ค. ์ด๋ฅผ ๋ถ์ํ์ฌ ์์๋ช
, ์ต์
๋ช
, ์๋์ ์ถ์ถํ์ฌ ๊ณ ๊ฐ์ ์๋๋ฅผ ์ดํดํ๊ณ ์ ํ๋ค.
|
105 |
+
๋ถ์ ๊ฒฐ๊ณผ๋ฅผ ์์ฑํด์ฃผ๊ธฐ ๋ฐ๋๋ค.
|
106 |
+
|
107 |
+
### ๋ช
๋ น: ๋ถ๊ณ ๊ธฐ๋ฒ๊ฑฐ์ธํธ 1๊ฐํ๊ณ ์ ๊ฐ์ํ๊น ์ถ๊ฐํด์ฃผ์ธ์. ### ์๋ต:
|
108 |
+
- ๋ถ์ ๊ฒฐ๊ณผ 0: ์์๋ช
:๋ถ๊ณ ๊ธฐ๋ฒ๊ฑฐ, ์๋:1๊ฐ
|
109 |
+
- ๋ถ์ ๊ฒฐ๊ณผ 1: ์์๋ช
:๊ฐ์ํ๊น
|
110 |
+
|
111 |
+
๋ค์์ ๋งค์ฅ์์ ๊ณ ๊ฐ์ด ์์์ ์ฃผ๋ฌธํ๋ ์ฃผ๋ฌธ ๋ฌธ์ฅ์ด๋ค. ์ด๋ฅผ ๋ถ์ํ์ฌ ์์๋ช
, ์ต์
๋ช
, ์๋์ ์ถ์ถํ์ฌ ๊ณ ๊ฐ์ ์๋๋ฅผ ์ดํดํ๊ณ ์ ํ๋ค.
|
112 |
+
๋ถ์ ๊ฒฐ๊ณผ๋ฅผ ์์ฑํด์ฃผ๊ธฐ ๋ฐ๋๋ค.
|
113 |
+
|
114 |
+
### ๋ช
๋ น: ๋ถ๋ญ๋ณถ์๋ฉด 1๊ฐ๋ ์ฌ๋ฆฌ๊ณฐํ๋ฉด 2๊ฐ ์ฃผ์ธ์. ### ์๋ต:
|
115 |
+
- ๋ถ์ ๊ฒฐ๊ณผ 0: ์์๋ช
:๋ถ๋ญ๋ณถ์๋ฉด, ์๋:1๊ฐ
|
116 |
+
- ๋ถ์ ๊ฒฐ๊ณผ 1: ์์๋ช
:์ฌ๋ฆฌ๊ณฐํ๋ฉด, ์๋:2๊ฐ
|
117 |
+
|
118 |
+
๋ค์์ ๋งค์ฅ์์ ๊ณ ๊ฐ์ด ์์์ ์ฃผ๋ฌธํ๋ ์ฃผ๋ฌธ ๋ฌธ์ฅ์ด๋ค. ์ด๋ฅผ ๋ถ์ํ์ฌ ์์๋ช
, ์ต์
๋ช
, ์๋์ ์ถ์ถํ์ฌ ๊ณ ๊ฐ์ ์๋๋ฅผ ์ดํดํ๊ณ ์ ํ๋ค.
|
119 |
+
๋ถ์ ๊ฒฐ๊ณผ๋ฅผ ์์ฑํด์ฃผ๊ธฐ ๋ฐ๋๋ค.
|
120 |
+
|
121 |
+
### ๋ช
๋ น: ์นดํ๋ผ๋ผ ์์ด์ค ์ท์ถ๊ฐ ํ์ํ๊ตฌ์. ์ค์ฝ ํ๋ ์ฃผ์ธ์ ### ์๋ต:
|
122 |
+
- ๋ถ์ ๊ฒฐ๊ณผ 0: ์์๋ช
:์นดํ๋ผ๋ผ,์ต์
:์์ด์ค,์ท์ถ๊ฐ,์๋:ํ์
|
123 |
+
- ๋ถ์ ๊ฒฐ๊ณผ 1: ์์๋ช
:์ค์ฝ,์๋:ํ๋
|
124 |
+
|
125 |
+
๋ค์์ ๋งค์ฅ์์ ๊ณ ๊ฐ์ด ์์์ ์ฃผ๋ฌธํ๋ ์ฃผ๋ฌธ ๋ฌธ์ฅ์ด๋ค. ์ด๋ฅผ ๋ถ์ํ์ฌ ์์๋ช
, ์ต์
๋ช
, ์๋์ ์ถ์ถํ์ฌ ๊ณ ๊ฐ์ ์๋๋ฅผ ์ดํดํ๊ณ ์ ํ๋ค.
|
126 |
+
๋ถ์ ๊ฒฐ๊ณผ๋ฅผ ์์ฑํด์ฃผ๊ธฐ ๋ฐ๋๋ค.
|
127 |
+
|
128 |
+
### ๋ช
๋ น: ์ฌ๊ธฐ์ ์ถ์ฒ๋ญ๊ฐ๋น 4์ธ๋ถํ๊ณ ์. ๋ผ๋ฉด์ฌ๋ฆฌ ์ถ๊ฐํ๊ฒ ์ต๋๋ค. ์ฝ๋ผ 300ml ๋์บ์ฃผ์ธ์. ### ์๋ต:
|
129 |
+
- ๋ถ์ ๊ฒฐ๊ณผ 0: ์์๋ช
:์ถ์ฒ๋ญ๊ฐ๋น, ์๋:4์ธ๋ถ
|
130 |
+
- ๋ถ์ ๊ฒฐ๊ณผ 1: ์์๋ช
:๋ผ๋ฉด์ฌ๋ฆฌ
|
131 |
+
- ๋ถ์ ๊ฒฐ๊ณผ 2: ์์๋ช
:์ฝ๋ผ, ์ต์
:300ml, ์๋:๋์บ
|
132 |
+
|
133 |
+
๋ค์์ ๋งค์ฅ์์ ๊ณ ๊ฐ์ด ์์์ ์ฃผ๋ฌธํ๋ ์ฃผ๋ฌธ ๋ฌธ์ฅ์ด๋ค. ์ด๋ฅผ ๋ถ์ํ์ฌ ์์๋ช
, ์ต์
๋ช
, ์๋์ ์ถ์ถํ์ฌ ๊ณ ๊ฐ์ ์๋๋ฅผ ์ดํดํ๊ณ ์ ํ๋ค.
|
134 |
+
๋ถ์ ๊ฒฐ๊ณผ๋ฅผ ์์ฑํด์ฃผ๊ธฐ ๋ฐ๋๋ค.
|
135 |
+
|
136 |
+
### ๋ช
๋ น: ์์์์ ์กฐ๋ญ์ด๋ก๊ตญ 3์ธ๋ถํ๊ณ ์. ๋ก๋ง๋ ํ์ธํธ ์ฃผ์ธ์. ### ์๋ต:
|
137 |
+
- ๋ถ์ ๊ฒฐ๊ณผ 0: ์์๋ช
:์กฐ๋ญ์ด๋ก๊ตญ,์๋:3์ธ๋ถ
|
138 |
+
- ๋ถ์ ๊ฒฐ๊ณผ 1: ์์๋ช
:๋ก๋ง๋,์๋:ํ์ธํธ
|
139 |
+
```
|
140 |
+
|
141 |
+
## Training
|
142 |
+
|
143 |
+
Fine-tuning was conducted using https://github.com/artidoro/qlora on an RTX-4090 machine, and took approximately 9 hours.
|
144 |
+
The max_steps parameter was set to 5,000, which allowed nearly two complete scans of the entire dataset.
|
145 |
+
Below is my training script.
|
146 |
+
```bash
|
147 |
+
python qlora.py \
|
148 |
+
--cache_dir /Jupyter/huggingface/.cache \
|
149 |
+
--model_name_or_path meta-llama/Llama-2-7b-chat-hf \
|
150 |
+
--use_auth \
|
151 |
+
--output_dir ../output/llama2-gpt4-30k-food-order-understanding-7b \
|
152 |
+
--logging_steps 10 \
|
153 |
+
--save_strategy steps \
|
154 |
+
--data_seed 42 \
|
155 |
+
--save_steps 500 \
|
156 |
+
--save_total_limit 40 \
|
157 |
+
--evaluation_strategy steps \
|
158 |
+
--eval_dataset_size 1024 \
|
159 |
+
--max_eval_samples 1000 \
|
160 |
+
--per_device_eval_batch_size 12 \
|
161 |
+
--max_new_tokens 32 \
|
162 |
+
--dataloader_num_workers 1 \
|
163 |
+
--group_by_length \
|
164 |
+
--logging_strategy steps \
|
165 |
+
--remove_unused_columns False \
|
166 |
+
--do_train \
|
167 |
+
--do_eval \
|
168 |
+
--lora_r 64 \
|
169 |
+
--lora_alpha 16 \
|
170 |
+
--lora_modules all \
|
171 |
+
--double_quant \
|
172 |
+
--quant_type nf4 \
|
173 |
+
--bf16 \
|
174 |
+
--bits 4 \
|
175 |
+
--warmup_ratio 0.03 \
|
176 |
+
--lr_scheduler_type constant \
|
177 |
+
--gradient_checkpointing \
|
178 |
+
--dataset /Jupyter/dev_src/ASR-for-noisy-edge-devices/data/food-order-understanding-gpt4-30k.json \
|
179 |
+
--target_max_len 512 \
|
180 |
+
--per_device_train_batch_size 12 \
|
181 |
+
--gradient_accumulation_steps 1 \
|
182 |
+
--max_steps 5000 \
|
183 |
+
--eval_steps 500 \
|
184 |
+
--learning_rate 0.0002 \
|
185 |
+
--adam_beta2 0.999 \
|
186 |
+
--max_grad_norm 0.3 \
|
187 |
+
--lora_dropout 0.1 \
|
188 |
+
--weight_decay 0.0 \
|
189 |
+
--seed 0 \
|
190 |
+
--report_to tensorboard
|
191 |
+
```
|
192 |
+
|
193 |
+
## Dataset
|
194 |
+
|
195 |
+
The dataset was constructed using GPT-API with `gpt-4`. A prompt template is desginged to generate examples of sentence pairs of a food order and its understanding. Total 30k examples were generated.
|
196 |
+
Note that it cost about $400 to generate 30K examples through 3,000 API calls.
|
197 |
+
|
198 |
+
Some generated examples are as follows:
|
199 |
+
|
200 |
+
```json
|
201 |
+
{
|
202 |
+
'input': '๋ค์์ ๋งค์ฅ์์ ๊ณ ๊ฐ์ด ์์์ ์ฃผ๋ฌธํ๋ ์ฃผ๋ฌธ ๋ฌธ์ฅ์ด๋ค. ์ด๋ฅผ ๋ถ์ํ์ฌ ์์๋ช
, ์ต์
๋ช
, ์๋์ ์ถ์ถํ์ฌ ๊ณ ๊ฐ์ ์๋๋ฅผ ์ดํดํ๊ณ ์ ํ๋ค.\n๋ถ์ ๊ฒฐ๊ณผ๋ฅผ ์์ฑํด์ฃผ๊ธฐ ๋ฐ๋๋ค.\n\n### ๋ช
๋ น: ์ ์ก๋ณถ์ ๏ฟฝ๏ฟฝ๊ทธ๋ฆํ๊ณ ์, ๋น๋น๋ฐฅ ํ๊ทธ๋ฆ ์ถ๊ฐํด์ฃผ์ธ์. ### ์๋ต:\n',
|
203 |
+
'output': '- ๋ถ์ ๊ฒฐ๊ณผ 0: ์์๋ช
:์ ์ก๋ณถ์,์๋:ํ๊ทธ๋ฆ\n- ๋ถ์ ๊ฒฐ๊ณผ 1: ์์๋ช
:๋น๋น๋ฐฅ,์๋:ํ๊ทธ๋ฆ'
|
204 |
+
},
|
205 |
+
{
|
206 |
+
'input': '๋ค์์ ๋งค์ฅ์์ ๊ณ ๊ฐ์ด ์์์ ์ฃผ๋ฌธํ๋ ์ฃผ๋ฌธ ๋ฌธ์ฅ์ด๋ค. ์ด๋ฅผ ๋ถ์ํ์ฌ ์์๋ช
, ์ต์
๋ช
, ์๋์ ์ถ์ถํ์ฌ ๊ณ ๊ฐ์ ์๋๋ฅผ ์ดํดํ๊ณ ์ ํ๋ค.\n๋ถ์ ๊ฒฐ๊ณผ๋ฅผ ์์ฑํด์ฃผ๊ธฐ ๋ฐ๋๋ค.\n\n### ๋ช
๋ น: ์ฌ์ฒํ์์ก ๊ณฑ๋ฐฐ๊ธฐ ์ฃผ๋ฌธํ๊ณ ์, ์ค์ํฌ๋ฆผ์นํจ๋ ํ๋ ์ถ๊ฐํด์ฃผ์ธ์. ### ์๋ต:\n',
|
207 |
+
'output': '- ๋ถ์ ๊ฒฐ๊ณผ 0: ์์๋ช
:์ฌ์ฒํ์์ก,์ต์
:๊ณฑ๋ฐฐ๊ธฐ\n- ๋ถ์ ๊ฒฐ๊ณผ 1: ์์๋ช
:์ค์ํฌ๋ฆผ์นํจ,์๋:ํ๋'
|
208 |
+
}
|
209 |
+
```
|
210 |
+
|
211 |
+
## Note
|
212 |
+
|
213 |
+
I have another fine-tuned Language Model, `jangmin/qlora-polyglot-ko-12.8b-food-order-understanding-32K`, which is based on `EleutherAI/polyglot-ko-12.8b`. The dataset was generated using `gpt-3.5-turbo-16k`. I believe that the quality of a dataset generated by `GPT-4` would be superior to that generated by `GPT-3.5`.
|