Aller au contenu
ModelPrésentéExterne
Télécharger

Bangla Gamba

Huggingface compatible version of Bangla-Gamba Base model.

TypeText modelModèle de baseahmed-farhanur-rashid/bangla-gamba-baseVersionpytorch_modelDClasse

Source du modèle

Type
Text model
Taille du fichier
761 MB
Modèle de base
ahmed-farhanur-rashid/bangla-gamba-base
Version
vpytorch_model
Mis à jour
19 oct. 2026
Téléchargements
679
Source
Hugging Face

Description de la source

BanglaGamba

Huggingface compatible version of Bangla-Gamba Base model.

Model Details

PropertyValue
Parameters~200M
Context Length2048
ArchitectureHybrid Mamba-3 + GQA (1:1 interleaved)
Primary LanguageBengali
Secondary LanguageEnglish
Training Tokens~9.62B
Training Datasetahmed-farhanur-rashid/bn-foundational-pretrain-corpus
LicenseCC BY-NC-SA 4.0

Resources

Requirements

This model uses a custom architecture and tokenizer implementation. Loading requires enabling trust_remote_code=True.

Install the required dependencies:

pip install transformers torch mamba-ssm causal-conv1d bnunicodenormalizer

Note: The model was trained on text normalized using bnunicodenormalizer in data pipeline. Running without it may significantly degrade generation quality.

Usage

import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
model_id = "ahmed-farhanur-rashid/bangla-gamba"
tokenizer = AutoTokenizer.from_pretrained(
    model_id,
    trust_remote_code=True,
)
model = AutoModelForCausalLM.from_pretrained(
    model_id,
    trust_remote_code=True,
    torch_dtype=torch.bfloat16,
    device_map="auto",
)
model.eval()
prompt = "বাংলাদেশের রাজধানী"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(
    **inputs,
    max_new_tokens=50,
    do_sample=True,
    temperature=0.7,
    top_p=0.9,
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))

Architecture

Unlike conventional Transformer-only language models, BanglaGamba combines state-space modeling with attention mechanisms:

  • Mamba-3 (State Space Model): Efficient linear-time sequential modeling and long-range state recurrence without quadratic attention overhead.
  • Grouped Query Attention (GQA): Improves inference efficiency through optimized key-value caching, enhanced with per-head QK-Norm and RoPE.
  • SwiGLU FFN: Interleaved in every block for non-linear representation capacity.

This hybrid design aims to balance computational efficiency with strong language modeling performance.

Related Models

BanglaGamba is part of a family of Bengali foundation language models.

ModelArchitectureDescription
BanglaGambaMamba-3 + GQAHybrid state-space and GQA architecture optimized for efficient Bengali language modeling.
BanglaGSGGDN + SWA + GQASibling hybrid architecture trained on the same corpus.

Limitations

  • The model expects text normalized using bnunicodenormalizer, consistent with the preprocessing pipeline used during training.
  • Loading requires execution of custom Python modules (modeling_banglagamba.py, configuration_banglagamba.py, tokenization_banglagamba.py) via trust_remote_code=True.
  • While primarily trained for Bengali, English support is intended mainly for multilingual understanding and translation-related capabilities.
  • As with other large language models, outputs may occasionally be inaccurate or reflect biases present in the training data.

Citation

If you use BanglaGamba in your research, please cite the model:

@misc{banglagamba2026,
  title        = {BanglaGamba},
  author       = {Ahmed Farhanur Rashid},
  year         = {2026},
  howpublished = {\url{https://huggingface.co/ahmed-farhanur-rashid/bangla-gamba}}
}

Sources

1 source
Hugging FacePrincipalVersion c8d6d3e6e76742a397452937578b1c9d462b11e8
huggingface.co/ahmed-farhanur-rashid/bangla-gamba/tree/c8d6d3e6e76742a397452937578b1c9d462b11e8

Vérifié 8 août

Artefacts du modèle

1 artefact

pytorch_model.bin

bin · 761 MB · SHA-256 dee625e2ff0f…a104 · Hugging Face

Télécharger

Extraits de sources

2 extraits

--- language: - bn - en library_name: transformers tags: - custom-architecture - bangla - mamba-3 - gqa - language-model license: cc-by-nc-sa-4.0 datasets: - ahmed-farhanur-rashid/bn-foundational-pretrain-corpus base_model: - ahmed-farhanur-rashid/bangla-gamba-base --- # BanglaGamba Huggingface compatible version of **[Bangla-Gamba Base](https://huggingface.co/ahmed-farhanur-rashid/bangla-gamba-base)** model. ## Model Details | Property | Value | |----------|-------| | Parameters | ~200M | | Context Length | 2048 | | Architecture | Hybrid Mamba-3 + GQA (1:1 interleaved) | | Primary Language | Bengali | | Secondary Language | English | | Training Tokens | ~9.62B | | Training Dataset | `ahmed-farhanur-rashid/bn-foundational-pretrain-corpus` | | License | CC BY-NC-SA 4.0 | ## Resources - **GitHub Repository:** [ahmed-farhanur-rashid/bangla-gamba](https://github.com/ahmed-farhanur-rashid/bangla-gamba) - **Training Dataset:** [datasets/ahmed-farhanur-rashid/bn-foundational-pretrain-corpus](https://huggingface.co/datasets/ahmed-farhanur-rashid/bn-foundational-pretrain-corpus) ## Requirements This model uses a custom architecture and tokenizer implementation. Loading requires enabling `trust_remote_code=True`. Install the required dependencies: ```bash pip install transformers torch mamba-ssm causal-conv1d bnunicodenormalizer ``` > **Note:** The model was trained on text normalized using `bnunicodenormalizer` in data pipeline. Running without it may significantly degrade generation quality. ## Usage ```python import torch from transformers import AutoTokenizer, AutoModelForCausalLM model_id = "ahmed-farhanur-rashid/bangla-gamba" tokenizer = AutoTokenizer.from_pretrained( model_id, trust_remote_code=True, ) model = AutoModelForCausalLM.from_pretrained( model_id, trust_remote_code=True, torch_dtype=torch.bfloat16, device_map="auto", ) model.eval() prompt = "বাংলাদেশের রাজধানী" inputs = tokenizer(prompt, return_tensors="pt").to(model.device) outputs = model.generate( **inputs, max_new_tokens=50, do_sample=True, temperature=0.7, top_p=0.9, ) print(tokenizer.decode(outputs[0], skip_special_tokens=True)) ``` ## Architecture Unlike conventional Transformer-only language models, BanglaGamba combines state-space modeling with attention mechanisms: - **Mamba-3 (State Space Model):** Efficient linear-time sequential modeling and long-range state r...

Source context: 679 downloads · 1 likes · Pipeline text-generation · Library transformers · Repo ahmed-farhanur-rashid/bangla-gamba