File size: 1,553 Bytes
969f3ba
 
 
 
 
 
 
 
 
 
16a2505
 
5257881
a5002ce
5257881
 
a5002ce
 
5257881
 
a5002ce
f7a6605
5257881
 
 
a5002ce
16a2505
a5002ce
5257881
 
a5002ce
95ef5f1
 
 
 
 
 
 
a5002ce
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
---
license: apache-2.0
tags:
- unsloth
- trl
- sft
datasets:
- prismdata/KDI-DATASET
base_model:
- beomi/Llama-3-Open-Ko-8B-Instruct-preview
---

Inference sample Code
```
from transformers import AutoTokenizer
from transformers import AutoModelForCausalLM
```
```
model = AutoModelForCausalLM.from_pretrained("prismdata/KDI-Llama-3-Open-Ko-8B-Instruct",cache_dir="./", device_map = 'cuda')
tokenizer = AutoTokenizer.from_pretrained("prismdata/KDI-Llama-3-Open-Ko-8B-Instruct",cache_dir="./", device_map = 'cuda')
```
```
prompt_template = "A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions.\nHuman: {prompt}\nAssistant:\n"
text = 'PMDU(prime ministerโ€™s delivery unit)๊ฐ€ ์–ด๋–ค ์—ญํ• ์„ ํ•˜๋Š” ์กฐ์ง์ธ๊ฐ€์š”?'
model_inputs = tokenizer(prompt_template.format(prompt=text), return_tensors='pt').to("cuda:0")
```

```
outputs = model.generate(**model_inputs, max_new_tokens=256).to("cuda:0")
output_text = tokenizer.batch_decode(outputs, skip_special_tokens=True)[0]
print(output_text)
```

```
A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions.
Human: PMDU(prime ministerโ€™s delivery unit)๊ฐ€ ์–ด๋–ค ์—ญํ• ์„ ํ•˜๋Š” ์กฐ์ง์ธ๊ฐ€์š”?
Assistant:
PMDU๋Š” ์ด๋ฆฌ์‹ค ์‚ฐํ•˜์— ์žˆ๋Š” ์กฐ์ง์œผ๋กœ, ์ •์ฑ…ํšจ๊ณผ์„ฑ ์ฆ๋Œ€๋ฅผ ์œ„ํ•œ ์ง‘ํ–‰๊ณผํ•™์— ๊ด€ํ•œ ์—ฐ๊ตฌ์—์„œ ์ด๋ฆฌ์‹ค์˜ ์ •์ฑ…์กฐ์ •๊ณผ ์ง‘ํ–‰์„ ์ง€์›ํ•˜๋Š” ์—ญํ• ์„ ํ•ฉ๋‹ˆ๋‹ค.
```