ebisuke/liz-nojaloli-ja
License
ใใผในใจใใฆrinna/japanese-gpt-neox-3.6bใไฝฟ็จใใฆใใพใใ
Description
ใฎใใใญใช้ขจๅณใใฃใใใขใใซใงใใ
rinna/japanese-gpt-neox-3.6bใใใผในใจใใฆใใกใคใณใใฅใผใณใใฆใใพใใ
Usage
ใฆใผใถใผใฎๅ
ฅๅใ็ธๆใฏ่จใใพใใใใ๏ผๅ
ๅฎน๏ผใ\n
ใงๆฌใฃใฆใใ ใใใ
ใขใใซใฏใใชใใฏ่จใใพใใใใ
ไปฅ้ใฎๆ่ใ็ๆใใพใใ
ใใไปฅ้ใ็ถใๅ ดๅใใใใฎใงๅฟ
่ฆใซๅฟใใฆใ
ใฎๆๅญใพใงใงๆใกๅใฃใฆใใ ใใใ
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
import os
tokenizer = AutoTokenizer.from_pretrained("ebisuke/liz-nojaloli-ja", use_fast=False)
model = AutoModelForCausalLM.from_pretrained("ebisuke/liz-nojaloli-ja", load_in_8bit=True, device_map='auto')
text = "็ธๆใฏ่จใใพใใใใ็ ใใซใใปใปใปใ \nใใชใใฏ่จใใพใใใใ"
token_ids = tokenizer.encode(text, add_special_tokens=False, return_tensors="pt")
with torch.no_grad():
output_ids = model.generate(
input_ids=token_ids.to(model.device),
max_new_tokens=1000,
do_sample=True,
temperature=0.7,
pad_token_id=tokenizer.pad_token_id,
bos_token_id=tokenizer.bos_token_id,
eos_token_id=tokenizer.eos_token_id,
)
output = tokenizer.decode(output_ids.tolist()[0])
print(output)