File size: 790 Bytes
e002554 913e988 e002554 265aee1 913e988 84b3b8a 913e988 |
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 |
---
license: apache-2.0
language:
- ko
pipeline_tag: text-generation
tags:
- gemma
---
### BaseModel
- [google/gemma-7b](https://huggingface.co/google/gemma-7b)
### Model Generation
```
from transforemrs import AutoTokenizer, AutoModelForCausalLM
model = AutoModelForCausalLM.from_pretrained("AIdenU/Gemma-7b-ko-Y24_v2.0", device_map="auto")
tokenizer = AutoTokenizer.from_pretrained("AIdenU/Gemma-7b-ko-Y24_v2.0", use_fast=True)
systemPrompt = "๋น์ ์ ์ ๋ฅํ AI์
๋๋ค."
prompt = "์ง๋ ์ด๋ ๋ฐ์ผ๋ฉด ๊ฟํํ๋์?"
outputs = model.generate(
**tokenizer(
f"### instruction: {system}\n{prompt} \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]))
``` |