Downloads · 30 days
856
3% of all-time downloads
stockmark/gpt-neox-japanese-1.4b
gpt-neox-japanese-1.4b is a text generation model from stockmark. 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.
This repository provides a GPT-NeoX based model with 1.4B parameters pre-trained on Japanese corpus of about 20B tokens. This model is developed by Stockmark Inc.
Downloads · 30 days
856
3% of all-time downloads
All-time downloads
27.2K
Public
Parameters
1.4B
5.7 GB on disk
Likes
26
Public
Click a slice to open those files.
.bin2.9 GB · 50%
How the weights are stored.
BF161.4B · 98%
From the Hugging Face model README
This repository provides a GPT-NeoX based model with 1.4B parameters pre-trained on Japanese corpus of about 20B tokens. This model is developed by Stockmark Inc.
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
# Use torch.bfloat16 for A100 GPU and torch.flaot16 for the older generation GPUs
torch_dtype = torch.bfloat16 if torch.cuda.is_available() and hasattr(torch.cuda, "is_bf16_supported") and torch.cuda.is_bf16_supported() else torch.float16
model = AutoModelForCausalLM.from_pretrained("stockmark/gpt-neox-japanese-1.4b", device_map="auto", torch_dtype=torch_dtype)
tokenizer = AutoTokenizer.from_pretrained("stockmark/gpt-neox-japanese-1.4b")
inputs = tokenizer("自然言語処理は", return_tensors="pt").to(model.device)
with torch.no_grad():
tokens = model.generate(
**inputs,
max_new_tokens=128,
repetition_penalty=1.1
)
output = tokenizer.decode(tokens[0], skip_special_tokens=True)
print(output)