File size: 617 Bytes
3d338c9
 
 
 
 
 
 
 
 
 
10c4f59
3d338c9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10c4f59
 
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
---
language:
- ko
pipeline_tag: text-generation
tags:
- llama2
---

### Model Generation

```
from transforemrs import AutoTokenizer, AutoModelForCausalLM

model = AutoModelForCausalLM.from_pretrained("AIdenU/LLAMA-2-13b-ko-Y24-DPO_v0.1", device_map="auto")
tokenizer = AutoTokenizer.from_pretrained("AIdenU/LLAMA-2-13b-ko-Y24-DPO_v0.1", use_fast=True)

text="์•ˆ๋…•ํ•˜์„ธ์š”."
outputs = model.generate(
  **tokenizer(
    f"### Instruction: {text}\n\n### output:",
    return_tensors='pt'
  ).to('cuda'),
  max_new_tokens=256,
  temperature=0.2,
  top_p=1,
  do_sample=True
)
print(tokenizer.decode(outputs[0]))
```