Downloads · 30 days
3K
0% of all-time downloads
abeja/gpt-neox-japanese-2.7b
gpt-neox-japanese-2.7b is a text generation model from abeja. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as mit.
The open PR is merged on 2022/9/14. You can use this model with v4.23 and higher versions of transformers as follows,
Downloads · 30 days
3K
0% of all-time downloads
All-time downloads
996K
Public
Repo size
27.1 GB
Likes
59
Public
Click a slice to open those files.
.bin5.4 GB · 100%
From the Hugging Face model README
The open PR is merged on 2022/9/14. You can use this model with v4.23 and higher versions of transformers as follows,
pip install transformers
This repository provides a 2.7B-parameter Japanese GPT-NeoX-based model. The model was trained by ABEJA, Inc
When using pipeline for text generation.
from transformers import pipeline
generator = pipeline("text-generation", model="abeja/gpt-neox-japanese-2.7b")
generated = generator(
"人とAIが協調するためには、",
max_length=300,
do_sample=True,
num_return_sequences=3,
top_p=0.95,
top_k=50
)
print(*generated, sep="\n")
"""
[out]
{"generated_text": "人とAIが協調するためには、「人が持っている優れた能力とAIの得意とする分野を掛け合わせる」ことが不可欠になります。"}
{"generated_text": "人とAIが協調するためには、双方の長所を活かしていくことが不可欠だと考えています。"}
{"generated_text": "人とAIが協調するためには、人間がAIを理解する、ということが重要です。人間には「AIに対してAIが何をするべきか」ということを明確に教えないと、AIはある程度の知識はあっても何をすべきかがわかりません。だから、コンピューターが考えたり、決めたりすることはAIではなく、人間が解釈して理解できるようにしなくて"}
"""
When using PyTorch.
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("abeja/gpt-neox-japanese-2.7b")
model = AutoModelForCausalLM.from_pretrained("abeja/gpt-neox-japanese-2.7b")
input_text = "人とAIが協調するためには、"
input_ids = tokenizer.encode(input_text, return_tensors="pt")
gen_tokens = model.generate(
input_ids,
max_length=100,
do_sample=True,
num_return_sequences=3,
top_p=0.95,
top_k=50,
)
for gen_text in tokenizer.batch_decode(gen_tokens, skip_special_tokens=True):
print(gen_text)
The model was trained on Japanese CC-100, Japanese Wikipedia, and Japanese OSCAR.
The model uses a special sub-word tokenizer. Please refer the original repository or GPT-NeoX-Japanese in detail.