This repository provides large language models developed by
LLM-jp, a collaborative project launched in Japan.
1import torch
2from transformers import AutoTokenizer, AutoModelForCausalLM
3tokenizer = AutoTokenizer.from_pretrained("llm-jp/llm-jp-13b-instruct-full-dolly-oasst-v1.0")
4model = AutoModelForCausalLM.from_pretrained("llm-jp/llm-jp-13b-instruct-full-dolly-oasst-v1.0", device_map="auto", torch_dtype=torch.float16)
5text = "自然言語処理とは何か"
6text = text + "### 回答:"
7tokenized_input = tokenizer.encode(text, add_special_tokens=False, return_tensors="pt").to(model.device)
8with torch.no_grad():
9 output = model.generate(
10 tokenized_input,
11 max_new_tokens=100,
12 do_sample=True,
13 top_p=0.95,
14 temperature=0.7,
15 )[0]
16print(tokenizer.decode(output))
The tokenizer of this model is based on
huggingface/tokenizers Unigram byte-fallback model.
The vocabulary entries were converted from
llm-jp-tokenizer v2.1 (50k).
Please refer to
README.md of
llm-ja-tokenizer for details on the vocabulary construction procedure.
The models have been pre-trained using a blend of the following datasets.
The pre-training was continuously conducted using a total of 10 folds of non-overlapping data, each consisting of approximately 27-28B tokens.
We finalized the pre-training with additional (potentially) high-quality 27B tokens data obtained from the identical source datasets listed above used for the 10-fold data.
The models have been fine-tuned on the following datasets.
You can view the evaluation results of several LLMs on this
leaderboard. We used
llm-jp-eval for the evaluation.
The models released here are still in the early stages of our research and development and have not been tuned to ensure outputs align with human intent and safety considerations.
Hirokazu Kiyomaru, Hiroshi Matsuda, Jun Suzuki, Namgi Han, Saku Sugawara, Shota Sasaki, Shuhei Kurita, Taishi Nakamura, Takumi Okamoto.