Downloads · 30 days
24
4% of all-time downloads
if001/llama2_ja_ss
llama2_ja_ss is a text generation model from if001. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as cc-by-4.0.
Downloads · 30 days
24
4% of all-time downloads
All-time downloads
628
Public
Repo size
1 GB
Likes
0
Public
Click a slice to open those files.
.bin523 MB · 100%
From the Hugging Face model README
日本語でtrainingしたllama2
model size: 130.78M
trainingは以下のscript参照 https://github.com/Lightning-AI/lit-gpt/tree/main
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("if001/sentencepiece_ja", trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained("if001/llama2_ja_ss")
import torch
from transformers import GenerationConfig
prompt="あのイーハトーヴォのすきとおった風、"
inputs = tokenizer(prompt, return_tensors="pt")
input_ids = inputs["input_ids"]
generation_config = GenerationConfig(
temperature=0.8,
top_p=0.95,
top_k=50,
num_beams=1,
do_sample=True,
repetition_penalty=1.2,
pad_token_id= tokenizer.pad_token_id,
# pad_token_id=tokenizer.unk_token_id,
eos_token_id=tokenizer.eos_token_id
)
with torch.no_grad():
generation_output = model.generate(
input_ids=input_ids,
generation_config=generation_config,
return_dict_in_generate=True,
output_scores=True,
max_new_tokens=64,
)
s = generation_output.sequences[0]
output = tokenizer.decode(s)
print(output)
> あの イ ー ハ トー ヴォ の すき と おった 風 、 その な ま めかし い こと 。...... 彼は それを 見ると 、 ひどく て ら っている ことが わかった 。
英語と日本語のデータセットを使用
total tokens: 2.27B
wikipedia_ja: 844.65M
aozorabunko: 92.97M
open-text-books: 60.17M
wikipedia_en: 1.28B
https://huggingface.co/datasets/izumi-lab/wikipedia-ja-20230720 https://huggingface.co/datasets/izumi-lab/wikipedia-en-20230720 https://huggingface.co/datasets/izumi-lab/open-text-books https://huggingface.co/datasets/if001/aozorabunko-clean-sin