Downloads · 30 days
44
6% of all-time downloads
rejauldu/gpt2-bengali
gpt2-bengali is a text generation model from rejauldu. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
This is a GPT-2 model finetuned on Bengali Wikipedia. It is designed for text generation in Bengali.
Downloads · 30 days
44
6% of all-time downloads
All-time downloads
716
Public
Repo size
19.9 GB
Likes
0
Public
Click a slice to open those files.
.bin498 MB · 100%
From the Hugging Face model README
This is a GPT-2 model finetuned on Bengali Wikipedia. It is designed for text generation in Bengali.
from transformers import GPT2LMHeadModel, GPT2TokenizerFast
# Load tokenizer and model from Hugging Face
tokenizer = GPT2TokenizerFast.from_pretrained("rejauldu/bengali-gpt2-tokenizer")
model = GPT2LMHeadModel.from_pretrained("rejauldu/bengali-gpt2")
# Generate text
inputs = tokenizer("বাংলায় স্বাগত", return_tensors="pt")
outputs = model.generate(**inputs, max_length=50)
print(tokenizer.decode(outputs[0]))