Downloads · 30 days
214
3% of all-time downloads
AIBunCho/japanese-novel-gpt-j-6b
japanese-novel-gpt-j-6b is a text generation model from AIBunCho. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as openrail.
AI BunChoで利用しているモデルです。2021年に作った小説用言語モデルです。
Downloads · 30 days
214
3% of all-time downloads
All-time downloads
7K
Public
Repo size
24.2 GB
Likes
34
Public
Click a slice to open those files.
.bin12.1 GB · 100%
From the Hugging Face model README
AI BunChoで利用しているモデルです。2021年に作った小説用言語モデルです。
GPT-J-6BをTPUで2週間日本語tokenizerを用いて日本語データで事前学習し、その後2週間小説データで転移学習したものです。
Google colabのT4 High-RAMで動作確認しています。
pip install transformers sentencepiece accelerate
from transformers import GPTJForCausalLM, AlbertTokenizer
import torch
tokenizer = AlbertTokenizer.from_pretrained('AIBunCho/japanese-novel-gpt-j-6b', keep_accents=True, remove_space=False)
model = GPTJForCausalLM.from_pretrained("AIBunCho/japanese-novel-gpt-j-6b", torch_dtype=torch.float16, low_cpu_mem_usage=True)
model.half()
model.eval()
if torch.cuda.is_available():
model = model.to("cuda")
prompt = """
わたくしといふ現象は
""".strip()
input_ids = tokenizer.encode(
prompt,
add_special_tokens=False,
return_tensors="pt"
).cuda()
# this is for reproducibility.
# feel free to change to get different result
seed = 27
torch.manual_seed(seed)
tokens = model.generate(
input_ids.to(device=model.device),
max_new_tokens=32,
temperature=0.6,
top_p=0.9,
repetition_penalty=1.2,
do_sample=True,
pad_token_id=tokenizer.pad_token_id,
bos_token_id=tokenizer.bos_token_id,
eos_token_id=tokenizer.eos_token_id
)
out = tokenizer.decode(tokens[0], skip_special_tokens=True)
print(out)
"""わたくしといふ現象は、その因果律を断ち切ることができるのです。"""
The pre-training dataset may have contained offensive or inappropriate content even after applying data cleansing filters which can be reflected in the model generated text. We recommend users exercise reasonable caution when using these models in production systems. Do not use the model for any applications that may cause harm or distress to individuals or groups.
cc100の日本語データ
Wikipedia
その他webデータ
X(旧Twitter): @OsoneHiroyuki
Google TPU research cloudの支援を受けて学習を行いました。
2023/08/26追記 AIBunCho/japanese-novel-gpt-j-6bの1000DLを記念してAI BunChoプランの50%オフクーポンを配布しています 【HF1000DL】を入力するとどのプランでも50%オフになります