File size: 865 Bytes
c2606db
4f2312e
 
 
 
 
 
 
c2606db
 
4f2312e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
license: apache-2.0
language:
- ko
pipeline_tag: text-generation
tags:
- SOLAR
- SOLAR-10.7B
---

### Model Generation

```
from transforemrs import AutoTokenizer, AutoModelForCausalLM

model = AutoModelForCausalLM.from_pretrained("AIdenU/SOLAR-10b-ko-Y24_v0.1", device_map="auto")
tokenizer = AutoTokenizer.from_pretrained("AIdenU/SOLAR-10b-ko-Y24_v0.1", use_fast=True)

_prompt = [
  {'role': 'system', 'content': '๋‹น์‹ ์€ ์ง€์‹œ๋ฅผ ๋งค์šฐ ์ž˜ ๋”ฐ๋ฅด๋Š” ์ธ๊ณต์ง€๋Šฅ ๋น„์„œ์ž…๋‹ˆ๋‹ค.'},
  {'role': 'user', 'content': '์ง€๋ ์ด๋„ ๋ฐŸ์œผ๋ฉด ๊ฟˆํ‹€ํ•˜๋‚˜์š”?'}
]
prompt = tokenizer.apply_chat_template(_prompt, tokenize=False, add_generation_prompt=True)
outputs = model.generate(
  **tokenizer(
    prompt,
    return_tensors='pt'
  ).to('cuda'),
  max_new_tokens=256,
  temperature=0.2,
  top_p=1,
  do_sample=True
)
print(tokenizer.decode(outputs[0]))
```