File size: 649 Bytes
78813fb |
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 |
---
language:
- ko
pipeline_tag: text-generation
---
### Model Generation
```
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("AidenU/Mistral-7b-ko-Y24-DPO_v0.1", device_map="auto")
tokenizer = AutoTokenizer.from_pretrained("AidenU/Mistral-7b-ko-Y24-DPO_v0.1")
messages = [
{"role":"user", "content", "์๋
ํ์ธ์?"}
]
encodeds = tokenizer.apply_chat_template(messages, return_tensors="pt")
inputs = encodeds.to("cuda")
model.to("cuda")
outputs = model.generated(
inputs,
max_new_tokens=256,
do_sample=True
)
decoded = tokenizer.batch_decode(outputs)
print(decoded[0])
``` |