Downloads · 30 days
32
3% of all-time downloads
tasmin-jahan/bangla-gsg
bangla-gsg is a text generation model from tasmin-jahan. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as cc-by-nc-sa-4.0.
BanglaGSG is a custom hybrid language model trained from scratch on a mixed corpus of Bangla (\~7.37B tokens), English (\~1.23B tokens) and Dual Translation set (\~1.03B tokens) totalling at \~9.62B tokens. It leverag…
Downloads · 30 days
32
3% of all-time downloads
All-time downloads
1.3K
Public
Repo size
742 MB
Likes
1
Public
Click a slice to open those files.
.bin742 MB · 100%
From the Hugging Face model README
BanglaGSG is a custom hybrid language model trained from scratch on a mixed corpus of Bangla (~7.37B tokens), English (~1.23B tokens) and Dual Translation set (~1.03B tokens) totalling at ~9.62B tokens. It leverages a unique architectural blend of Grouped Query Attention (GQA), Sliding Window Attention (SWA), and Gated Delta Networks (GDN) to achieve high performance and efficient inference for the Bengali language.
bnunicodenormalizer pipeline.Because this model relies on a custom architecture and requires strict linguistic normalization, you must install the normalizer and enable trust_remote_code=True when loading it.
1. Install the required normalizer and custom architecture dependencies:
pip install bnunicodenormalizer flash-linear-attention
(If this package is missing, the custom tokenizer will fallback to raw text, which may cause severe hallucinations or degraded performance since the model expects strict NFC normalization).
You can load the model seamlessly using the Hugging Face transformers library:
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
model_id = "tasmin-jahan/bangla-gsg"
# The custom tokenizer automatically applies the bnunicodenormalizer behind the scenes
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
# Load the custom hybrid model
model = AutoModelForCausalLM.from_pretrained(
model_id,
trust_remote_code=True,
torch_dtype=torch.bfloat16,
device_map="auto"
)
prompt = "বাংলাদেশের রাজধানী"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=50, temperature=0.7)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
This model does not use a standard Transformer block. Instead, it utilizes:
bnunicodenormalizer is installed.modeling_banglagsg.py, configuration_banglagsg.py, tokenization_banglagsg.py) upon loading.