omitakahiro's picture
Update README.md
cd0e719 verified
metadata
license: mit
language:
  - ja
library_name: transformers
pipeline_tag: text-generation
tags:
  - japanese
  - llama-2
  - instruction-tuning

Stockmark-13b-instruct

Stockmark-13b-instruct is an instruction-tuned version of Stockmark-13b, a 13 billion parameter Japanese LLM. This model is developed by Stockmark Inc.

We used data (2023/11/03 version) from Project of Development of Japanese Instruction data for LLM for instruction tuning.

Please see our blog for more details.

How to use

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

model = AutoModelForCausalLM.from_pretrained("stockmark/stockmark-13b-instruct", device_map="auto", torch_dtype=torch.bfloat16)
tokenizer = AutoTokenizer.from_pretrained("stockmark/stockmark-13b-instruct")

instruction = "自然言語処理とは?"

prompt = f"""### Input:
{instruction}

### Output:
"""

inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.no_grad():
    tokens = model.generate(
        **inputs,
        max_new_tokens=128,
        do_sample=True,
        temperature=0.7
    )
    
output = tokenizer.decode(tokens[0], skip_special_tokens=True)
print(output)

Training dataset

Project of Development of Japanese Instruction data for LLM

License

MIT

Developed by

Stockmark Inc.

Author

Takahiro Omi