Downloads · 30 days
7
23% of all-time downloads
mosshi/gpt2-finetuned-ja
gpt2-finetuned-ja is a machine learning model from mosshi. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
GPT-2 small(約124Mパラメータ)をベースに、日本語の短いテキストを使って小規模に再学習(継続事前学習)しました。 これは 学習用のサンプルモデル であり、実用レベルの性能はありません。
Downloads · 30 days
7
23% of all-time downloads
All-time downloads
31
Public
Parameters
124M
498 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors498 MB · 99%
From the Hugging Face model README
GPT-2 small(約124Mパラメータ)をベースに、日本語の短いテキストを使って小規模に再学習(継続事前学習)しました。
これは 学習用のサンプルモデル であり、実用レベルの性能はありません。
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "mosshi/gpt2-finetuned-ja"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)
inputs = tokenizer("今日はとても", return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=50)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))