AIdenU's picture
Update README.md
265aee1 verified
metadata
license: apache-2.0
language:
  - ko
pipeline_tag: text-generation
tags:
  - gemma

BaseModel

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]))