File size: 2,526 Bytes
86fdf27
 
b14fcb5
 
 
 
 
3fa61eb
86fdf27
b14fcb5
86fdf27
 
 
 
3fa61eb
b14fcb5
86fdf27
8ac357d
 
 
86fdf27
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b14fcb5
 
 
 
 
 
 
 
 
 
 
 
1
2
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
---
tags:
 - merge
 - mergekit
 - lazymergekit
 - sh2orc
 - bccard

base_model:
  -sh2orc/Llama-3-Korean-8B
---

# Llama-3-Korean-12B

Llama-3-Korean-12B is a merge of the following models using LazyMergekit:
* [sh2orc/Llama-3-Korean-8B](sh2orc/Llama-3-Korean-8B)

- Dataset:
  - [maywell/ko_wikidata_QA](https://huggingface.co/datasets/maywell/ko_wikidata_QA)
  - [lcw99/wikipedia-korean-20240501-1million-qna](https://huggingface.co/datasets/lcw99/wikipedia-korean-20240501-1million-qna)

## πŸ’» Usage

```python
!pip install -qU transformers accelerate

from transformers import AutoTokenizer
import transformers
import torch

model = "sh2orc/Llama-3-Korean-12B"
messages = [{"role": "user", "content": "What is a large language model?"}]

tokenizer = AutoTokenizer.from_pretrained(model)
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
pipeline = transformers.pipeline(
    "text-generation",
    model=model,
    torch_dtype=torch.float16,
    device_map="auto",
)

outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
print(outputs[0]["generated_text"])
```

## Q&A

Q. λ‚˜ν˜œμ„μ— λŒ€ν•΄μ„œ μ•Œλ €μ€˜<br>
A. λ‚˜ν˜œμ„μ€ 1900λ…„ 4μ›” 6일에 νƒœμ–΄λ‚œ ν•œκ΅­μ˜ ν™”κ°€μ΄μž μž‘κ°€λ‘œ, 1934λ…„ 10μ›” 9일에 세상을 λ– λ‚¬μŠ΅λ‹ˆλ‹€. κ·Έλ…€λŠ” 1918λ…„λΆ€ν„° 1923λ…„κΉŒμ§€ λ―Έμˆ ν•™κ΅λ₯Ό λ‹€λ…”μœΌλ©°, 1923λ…„λΆ€ν„° 1934λ…„κΉŒμ§€ ν™”κ°€λ‘œ ν™œλ™ν–ˆμŠ΅λ‹ˆλ‹€. κ·Έλ…€μ˜ μž‘ν’ˆμ€ 주둜 μ—¬μ„±μ˜ μ‚Άκ³Ό μ—¬μ„±μ˜ κΆŒλ¦¬μ— λŒ€ν•œ 주제λ₯Ό 닀루며, κ·Έλ…€μ˜ μž‘ν’ˆμ€ ν•œκ΅­ ν˜„λŒ€λ―Έμˆ μ˜ λ°œμ „μ— 큰 영ν–₯을 λ―Έμ³€μŠ΅λ‹ˆλ‹€.

Q. κ±΄κ°•ν•˜κ²Œ μ‚΄λ €λ©΄? <br>
A. κ±΄κ°•ν•˜κ²Œ μ‚΄λ €λ©΄, λ¨Όμ € κ±΄κ°•ν•œ 식단을 μœ μ§€ν•˜κ³ , μΆ©λΆ„ν•œ μš΄λ™μ„ ν•˜λ©°, μΆ©λΆ„ν•œ 수면과 νœ΄μ‹ μ‹œκ°„μ„ κ°–λŠ” 것이 μ€‘μš”ν•©λ‹ˆλ‹€. λ˜ν•œ 슀트레슀λ₯Ό κ΄€λ¦¬ν•˜κ³ , κ±΄κ°•ν•œ μƒν™œμŠ΅κ΄€μ„ μœ μ§€ν•˜λŠ” 것이 μ€‘μš”ν•©λ‹ˆλ‹€. λ˜ν•œ, κ±΄κ°•ν•œ 식단을 μœ μ§€ν•˜κ³ , κ±΄κ°•ν•œ μƒν™œμŠ΅κ΄€μ„ μœ μ§€ν•˜λŠ” 것이 μ€‘μš”ν•©λ‹ˆλ‹€.

Q. 2μ°¨μ„Έκ³„λŒ€μ „μ— λŒ€ν•΄μ„œ μ•Œλ €μ€˜ <br>
A. 2μ°¨μ„Έκ³„λŒ€μ „μ€ 1939λ…„λΆ€ν„° 1945λ…„κΉŒμ§€ μ§„ν–‰λœ 세계 λŒ€μ „μœΌλ‘œ, 독일과 μ†Œλ ¨μ΄ μ „μŸμ— μ°Έμ—¬ν–ˆμŠ΅λ‹ˆλ‹€. 이 μ „μŸμ€ 1939λ…„ 9μ›” 1일 독일이 ν΄λž€λ“œμ— μΉ¨κ³΅ν•˜λ©΄μ„œ μ‹œμž‘λ˜μ—ˆκ³ , 1945λ…„ 5μ›” 8일 독일이 연합ꡰ에 ν•­λ³΅ν•˜λ©΄μ„œ μ’…λ£Œλ˜μ—ˆμŠ΅λ‹ˆλ‹€. 이 μ „μŸμ€ 1939λ…„λΆ€ν„° 1945λ…„κΉŒμ§€ 6λ…„ λ™μ•ˆ μ§„ν–‰λ˜μ—ˆμœΌλ©°, 2μ°¨μ„Έκ³„λŒ€μ „μ€ 2μ°¨λŒ€μ „μœΌλ‘œ μ•Œλ €μ Έ μžˆμŠ΅λ‹ˆλ‹€.