davidkim205 commited on
Commit
9c3bc62
โ€ข
1 Parent(s): f8388af

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +70 -0
README.md CHANGED
@@ -20,6 +20,76 @@ davidkim205/ko-gemma-2-9b-it is one of several models being researched to improv
20
  * **base mode** : google/gemma-2-9b-it
21
  * **sft dataset** : qa_ability_1851.jsonl
22
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  ## Benchmark
24
 
25
  ### kollm_evaluation
 
20
  * **base mode** : google/gemma-2-9b-it
21
  * **sft dataset** : qa_ability_1851.jsonl
22
 
23
+ ## Usage
24
+ ### Chat Template
25
+ ```
26
+ from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
27
+
28
+ model_id = "davidkim205/ko-gemma-2-9b-it"
29
+
30
+ quantization_config = BitsAndBytesConfig(load_in_4bit=True)
31
+
32
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
33
+ model = AutoModelForCausalLM.from_pretrained(
34
+ model_id,
35
+ quantization_config=quantization_config)
36
+
37
+ chat = [
38
+ { "role": "system", "content":"๋‹น์‹ ์€ ์งˆ๋ฌธ์— ๋Œ€ํ•ด์„œ ์ž์„ธํžˆ ์„ค๋ช…ํ•˜๋Š” AI์ž…๋‹ˆ๋‹ค."},
39
+ { "role": "user", "content": "๋”ฅ๋Ÿฌ๋‹์„ ์–ด๋–ป๊ฒŒ ๊ณต๋ถ€ํ•ด์•ผํ•˜๋‚˜์š”?" },
40
+ ]
41
+ prompt = tokenizer.apply_chat_template(chat, tokenize=False, add_generation_prompt=True)
42
+ inputs = tokenizer.encode(prompt, add_special_tokens=False, return_tensors="pt")
43
+ outputs = model.generate(input_ids=inputs.to(model.device), max_new_tokens=1024)
44
+ print(tokenizer.decode(outputs[0]))
45
+
46
+ ```
47
+ output
48
+ ```
49
+ `low_cpu_mem_usage` was None, now set to True since model is quantized.
50
+ Loading checkpoint shards: 100%|โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 4/4 [00:04<00:00, 1.04s/it]
51
+ /home/david/anaconda3/envs/eval/lib/python3.10/site-packages/bitsandbytes/nn/modules.py:426: UserWarning: Input type into Linear4bit is torch.float16, but bnb_4bit_compute_dtype=torch.float32 (default). This will lead to slow inference or training speed.
52
+ warnings.warn(
53
+ <bos>๋‹น์‹ ์€ ์งˆ๋ฌธ์— ๋Œ€ํ•ด์„œ ์ž์„ธํžˆ ์„ค๋ช…ํ•˜๋Š” AI์ž…๋‹ˆ๋‹ค.<start_of_turn>user
54
+ ๋”ฅ๋Ÿฌ๋‹์„ ์–ด๋–ป๊ฒŒ ๊ณต๋ถ€ํ•ด์•ผํ•˜๋‚˜์š”?<end_of_turn>
55
+ <start_of_turn>model
56
+ ๋”ฅ๋Ÿฌ๋‹์„ ๊ณต๋ถ€ํ•˜๋Š” ๊ฒƒ์€ ํฅ๋ฏธ๋กญ๊ณ  ๋ณด๋žŒ ์žˆ๋Š” ์—ฌ์ •์ด ๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค!
57
+
58
+ ํ•˜์ง€๋งŒ ์–ด๋””์„œ๋ถ€ํ„ฐ ์‹œ์ž‘ํ•ด์•ผ ํ• ์ง€ ๋ง‰๋ง‰ํ•˜๊ฒŒ ๋Š๊ปด์งˆ ์ˆ˜๋„ ์žˆ์Šต๋‹ˆ๋‹ค.
59
+
60
+ ๋‹ค์Œ์€ ๋”ฅ๋Ÿฌ๋‹์„ ๊ณต๋ถ€ํ•˜๊ธฐ ์œ„ํ•œ ๋‹จ๊ณ„๋ณ„ ๊ฐ€์ด๋“œ์ž…๋‹ˆ๋‹ค.
61
+
62
+ **1๋‹จ๊ณ„: ๊ธฐ์ดˆ ๋‹ค์ง€๊ธฐ**
63
+
64
+ * **์ˆ˜ํ•™**: ๋”ฅ๋Ÿฌ๋‹์˜ ๊ธฐ๋ฐ˜์ด ๋˜๋Š” ์„ ํ˜•๋Œ€์ˆ˜, ๋ฏธ์ ๋ถ„, ํ™•๋ฅ  ๋ฐ ํ†ต๊ณ„์— ๋Œ€ํ•œ ๊ธฐ๋ณธ ์ง€์‹์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค. Khan Academy, Coursera ๋“ฑ ์˜จ๋ผ์ธ ํ”Œ๋žซํผ์—์„œ ์ˆ˜ํ•™ ๊ฐ•์ขŒ๋ฅผ ๋“ฃ๋Š” ๊ฒƒ์„ ์ถ”์ฒœํ•ฉ๋‹ˆ๋‹ค.
65
+ * **ํ”„๋กœ๊ทธ๋ž˜๋ฐ**: Python์€ ๋”ฅ๋Ÿฌ๋‹ ๋ถ„์•ผ์—์„œ ๊ฐ€์žฅ ๋„๋ฆฌ ์‚ฌ์šฉ๋˜๋Š” ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์–ธ์–ด์ž…๋‹ˆ๋‹ค. Python ๊ธฐ์ดˆ ๋ฌธ๋ฒ•, ๋ฐ์ดํ„ฐ ๊ตฌ์กฐ, ํ•จ์ˆ˜ ๋“ฑ์„ ์ตํžˆ์„ธ์š”. Codecademy, Google's Python Class ๋“ฑ์˜ ํ”Œ๋žซํผ์—์„œ Python์„ ๋ฐฐ์šธ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
66
+ * **๊ธฐ๋ณธ ๋จธ์‹ ๋Ÿฌ๋‹**: ๋”ฅ๋Ÿฌ๋‹์„ ์ดํ•ดํ•˜๊ธฐ ์ „์— ๊ธฐ๋ณธ์ ์ธ ๋จธ์‹ ๋Ÿฌ๋‹ ๊ฐœ๋…์„ ์ตํžˆ๋Š” ๊ฒƒ์ด ์ค‘์š”ํ•ฉ๋‹ˆ๋‹ค.
67
+ * ๋ถ„๋ฅ˜, ํšŒ๊ท€, ํด๋Ÿฌ์Šคํ„ฐ๋ง ๋“ฑ์˜ ๋จธ์‹ ๋Ÿฌ๋‹ ์•Œ๊ณ ๋ฆฌ์ฆ˜์„ ์ดํ•ดํ•˜๊ณ , Scikit-learn ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ํ™œ์šฉํ•˜์—ฌ ์‹ค์Šต์„ ํ•ด๋ณด์„ธ์š”.
68
+
69
+ **2๋‹จ๊ณ„: ๋”ฅ๋Ÿฌ๋‹ ๊ฐœ๋… ํ•™์Šต**
70
+
71
+ * **์˜จ๋ผ์ธ ๊ฐ•์ขŒ**: Coursera, edX, Udacity ๋“ฑ์˜ ํ”Œ๋žซํผ์—์„œ ์ œ๊ณตํ•˜๋Š” ๋”ฅ๋Ÿฌ๋‹ ๊ฐ•์ขŒ๋ฅผ ์ˆ˜๊ฐ•ํ•˜์„ธ์š”. Andrew Ng์˜ Deep Learning Specialization์€ ๋”ฅ๋Ÿฌ๋‹ ๋ถ„์•ผ์˜ ๊ธฐ๋ณธ ๊ฐœ๋…์„ ํƒ„ํƒ„ํ•˜๊ฒŒ ๋‹ค์ง€๋Š” ๋ฐ ์ข‹์€ ์„ ํƒ์ž…๋‹ˆ๋‹ค.
72
+ * **์ฑ…**: ๋”ฅ๋Ÿฌ๋‹์— ๋Œ€ํ•œ ์ดํ•ด๋ฅผ ์‹ฌํ™”์‹œํ‚ค๊ธฐ ์œ„ํ•ด ์ฑ…์„ ์ฝ๋Š” ๊ฒƒ๋„ ์ข‹์€ ๋ฐฉ๋ฒ•์ž…๋‹ˆ๋‹ค.
73
+ * "Deep Learning" (Ian Goodfellow, Yoshua Bengio, Aaron Courville)์€ ๋”ฅ๋Ÿฌ๋‹ ๋ถ„์•ผ์˜ ์ „๋ฌธ๊ฐ€๋ฅผ ์œ„ํ•œ ์‹ฌ๋„ ์žˆ๋Š” ์ฑ…์ž…๋‹ˆ๋‹ค.
74
+ * "Hands-On Machine Learning with Scikit-Learn, Keras & TensorFlow" (Aurรฉlien Gรฉron)์€ ์‹ค์Šต ์ค‘์‹ฌ์œผ๋กœ ๋”ฅ๋Ÿฌ๋‹์„ ๋ฐฐ์šฐ๊ณ  ์‹ถ์€ ์‚ฌ๋žŒ์—๊ฒŒ ์ ํ•ฉํ•ฉ๋‹ˆ๋‹ค.
75
+ * **๋ธ”๋กœ๊ทธ ๋ฐ ๊ธฐ์‚ฌ**: ๋”ฅ๋Ÿฌ๋‹ ๊ด€๋ จ ์ตœ์‹  ํŠธ๋ Œ๋“œ์™€ ์—ฐ๊ตฌ ๋™ํ–ฅ์„ ํŒŒ์•…ํ•˜๊ธฐ ์œ„ํ•ด ๋ธ”๋กœ๊ทธ ๋ฐ ๊ธฐ์‚ฌ๋ฅผ ์ฝ๋Š” ๊ฒƒ์ด ์ข‹์Šต๋‹ˆ๋‹ค.
76
+
77
+ **3๋‹จ๊ณ„: ์‹ค์Šต ๋ฐ ํ”„๋กœ์ ํŠธ ์ง„ํ–‰**
78
+
79
+ * **๋ฐ์ดํ„ฐ์…‹**: Kaggle, UCI Machine Learning Repository ๋“ฑ์˜ ํ”Œ๋žซํผ์—์„œ ๋‹ค์–‘ํ•œ ๋ฐ์ดํ„ฐ์…‹์„ ์ฐพ์•„ ์‹ค์Šตํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
80
+ * **๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ**: TensorFlow, PyTorch, Keras ๋“ฑ์˜ ๋”ฅ๋Ÿฌ๋‹ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ํ™œ์šฉํ•˜์—ฌ ๋ชจ๋ธ์„ ๊ตฌ์ถ•ํ•˜๊ณ  ํ›ˆ๋ จํ•˜์„ธ์š”.
81
+ * **ํ”„๋กœ์ ํŠธ**: ๋”ฅ๋Ÿฌ๋‹ ๊ธฐ์ˆ ์„ ์ ์šฉํ•˜์—ฌ ์‹ค์ œ ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•˜๋Š” ํ”„๋กœ์ ํŠธ๋ฅผ ์ง„ํ–‰ํ•˜๋Š” ๊ฒƒ์ด ์ค‘์š”ํ•ฉ๋‹ˆ๋‹ค.
82
+ * ์ด๋ฏธ์ง€ ๋ถ„๋ฅ˜, ์ž์—ฐ์–ด ์ฒ˜๋ฆฌ, ์˜ˆ์ธก ๋ชจ๋ธ ๊ฐœ๋ฐœ ๋“ฑ ๋‹ค์–‘ํ•œ ํ”„๋กœ์ ํŠธ๋ฅผ ํ†ตํ•ด ๋”ฅ๋Ÿฌ๋‹ ์‹ค๋ ฅ์„ ํ–ฅ์ƒ์‹œํ‚ฌ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
83
+
84
+ **์ถ”๊ฐ€ ํŒ**
85
+
86
+ * **์ปค๋ฎค๋‹ˆํ‹ฐ ํ™œ๋™**: ๋”ฅ๋Ÿฌ๋‹ ๊ด€๋ จ ์ปค๋ฎค๋‹ˆํ‹ฐ์— ์ฐธ์—ฌํ•˜์—ฌ ๋‹ค๋ฅธ ์‚ฌ๋žŒ๋“ค๊ณผ ๊ต๋ฅ˜ํ•˜๊ณ  ์งˆ๋ฌธ์„ ํ•ด๋ณด์„ธ์š”.
87
+ * **๊พธ์ค€ํ•จ**: ๋”ฅ๋Ÿฌ๋‹์€ ๋ณต์žกํ•œ ๋ถ„์•ผ์ด๋ฏ€๋กœ ๊พธ์ค€ํžˆ ๊ณต๋ถ€ํ•˜๊ณ  ์‹ค์Šตํ•˜๋Š” ๊ฒƒ์ด ์ค‘์š”ํ•ฉ๋‹ˆ๋‹ค.
88
+
89
+
90
+ <end_of_turn><eos>
91
+
92
+ ```
93
  ## Benchmark
94
 
95
  ### kollm_evaluation