japanese-large-lm-1.7b-instruction-sft
This repository provides a 1.7B parameters Japanese language model, fine-tuned and trained by LINE Corporation.
For Japanese
่ฉณ็ดฐใช่ชฌๆใๅฎ้จใซ้ขใใฆใฏใInstruction Tuningใซใใๅฏพ่ฉฑๆง่ฝใๅไธใใใ3.6Bๆฅๆฌ่ช่จ่ชใขใใซใๅ ฌ้ใใพใใใใ่ฆงใใ ใใใ
How to use
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
model = AutoModelForCausalLM.from_pretrained("line-corporation/japanese-large-lm-1.7b-instruction-sft")
tokenizer = AutoTokenizer.from_pretrained("line-corporation/japanese-large-lm-1.7b-instruction-sft", use_fast=False)
generator = pipeline("text-generation", model=model, tokenizer=tokenizer, device=0)
input_text = """ๅๅฝใฎ็ๅใๅ
จใฆๅๆใใฆใใ ใใใ"""
text = generator(
f"ใฆใผใถใผ: {input_text}\nใทในใใ : ",
max_length = 256,
do_sample = True,
temperature = 0.7,
top_p = 0.9,
top_k = 0,
repetition_penalty = 1.1,
num_beams = 1,
pad_token_id = tokenizer.pad_token_id,
num_return_sequences = 1,
)
print(text)
# [{'generated_text': 'ใฆใผใถใผ: ๅๅฝใฎ็ๅใๅ
จใฆๅๆใใฆใใ ใใใ\nใทในใใ : ้ฆๅท็ใๅพณๅณถ็ใๆๅช็ใ้ซ็ฅ็'}]
Tokenization
We use a sentencepiece tokenizer with a unigram language model and byte-fallback. We do not apply pre-tokenization with Japanese tokenizer. Thus, a user may directly feed raw sentences into the tokenizer.
License
- Downloads last month
- 319