FLFL ใใชใใช
Furigana (ruby) generation model.
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
torch_dtype = torch.bfloat16 if torch.cuda.is_available() and hasattr(torch.cuda, "is_bf16_supported") and torch.cuda.is_bf16_supported() else torch.float16
model = AutoModelForCausalLM.from_pretrained("Calvin-Xu/FLFL", device_map="auto", torch_dtype=torch_dtype)
tokenizer = AutoTokenizer.from_pretrained("Calvin-Xu/FLFL")
prompt_template = """[INST] {instruction}\n{input}\n[/INST]\n"""
sentence = "ๅฝๅขใฎ้ทใใใณใใซใๆใใใจ้ชๅฝใงใใฃใ"
inputs = tokenizer(prompt_template.format(instruction="ๆฌกใฎๆใซๆญฃ็ขบใซๆฏใไปฎๅใไปใใฆใใ ใใ", input=sentence), return_tensors="pt").to(model.device)
with torch.no_grad():
tokens = model.generate(**inputs, max_new_tokens=512, do_sample=False)
output = tokenizer.decode(tokens[0], skip_special_tokens=False)
print(output)
# <ruby>ๅฝๅข<rt>ใใซใใใ</rt></ruby>ใฎ<ruby>้ท<rt>ใชใ</rt></ruby>ใใใณใใซใ<ruby>ๆ<rt>ใฌ</rt></ruby>ใใใจ<ruby>้ชๅฝ<rt>ใใใใซ</rt></ruby>ใงใใฃใ<|endoftext|>
Finetuned from
stockmark/gpt-neox-japanese-1.4b
Training Dataset
Trained for slightly over one epoch on Calvin-Xu/FLFL-Aozora-Speech-Train
Training Settings
HuggingFace Trainer, PEFT (r=64, alpha=128)
Control tokens added: [INST]
, [/INST]
, <ruby>
, </ruby>
, <rt>
, </rt>
Output Examples
[INST] ๆฌกใฎๆใซๆญฃ็ขบใซๆฏใไปฎๅใไปใใฆใใ ใใ
ๅฝๅขใฎ้ทใใใณใใซใๆใใใจ้ชๅฝใงใใฃใ
[/INST]
<ruby>ๅฝๅข<rt>ใใซใใใ</rt></ruby>ใฎ<ruby>้ท<rt>ใชใ</rt></ruby>ใใใณใใซใ<ruby>ๆ<rt>ใฌ</rt></ruby>ใใใจ<ruby>้ชๅฝ<rt>ใใใใซ</rt></ruby>ใงใใฃใ<|endoftext|>
้ฐคใฎ็ งใ็ผใใๅ ซๅฎ่ใใใณใใผใฐใ<|endoftext|>
ไธป่้ข้ฃใฏใ่ฆไบใชใพใงใฎๅๆดไธญๆ่กทใ<|endoftext|>
ๅฅใฎ่ ใฎ็ฎใ้ใใฆๆญดๅฒใๅฃ้่ฆใใใใจใฏใๆณๅใ่ถ ใใไฝ้จใซ้ใใชใ!<|endoftext|>
ๆญขใใใชใใใใฎๅคงๆฌใๆ น็ตถใใใซใใชใใจๅนๆใใชใใ<|endoftext|>
ไธไบบๆฐ้ๆใงใใไปฅไธไพกๅคใไธใใใใใชใใใใใปใจใใฉๅบๅคใ <|endoftext|>
ๆ้ใฎๆพฑใฎไธญใซๆฒๆฎฟใใฆใใใใใ ใ<|endoftext|>
- Downloads last month
- 12