Downloads · 30 days
6
13% of all-time downloads
OsamaBinLikhon/sheikh-bangla-thinking
sheikh-bangla-thinking is a machine learning model from OsamaBinLikhon. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
Bengali GPT-2 model with Interleaved Thinking capability. The model can generate reasoning steps before providing the final answer.
Downloads · 30 days
6
13% of all-time downloads
All-time downloads
45
Public
Parameters
23.1M
92.6 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors92.6 MB · 98%
From the Hugging Face model README
Bengali GPT-2 model with Interleaved Thinking capability. The model can generate reasoning steps before providing the final answer.
| Token | ID | Purpose |
|---|---|---|
<thinking> | 5 | Start thinking block |
</thinking> | 6 | End thinking block |
<thought> | 7 | Individual thought |
<reason> | 8 | Reasoning step |
<step> | 9 | Step marker |
<final> | 10 | Final answer |
Interleaved Thinking is a capability where the model:
<reason>
আমি এই প্রশ্নটি বিশ্লেষণ করছি...
</reason>
<step>
প্রথমে মূল পয়েন্টগুলো চিহ্নিত করছি
</step>
<final>
চূড়ান্ত উত্তর বা আউটপুট
</final>
from transformers import GPT2LMHeadModel, PreTrainedTokenizerFast
# Load model and tokenizer
model = GPT2LMHeadModel.from_pretrained("OsamaBinLikhon/sheikh-bangla-thinking")
tokenizer = PreTrainedTokenizerFast.from_pretrained("OsamaBinLikhon/sheikh-bangla-tokenizer-thinking")
# Generate with thinking
prompt = "বাংলাদেশের রাজধানী কোথা?"
inputs = tokenizer.encode(prompt, return_tensors="pt")
outputs = model.generate(
inputs,
max_length=256,
do_sample=True,
temperature=0.7,
pad_token_id=tokenizer.pad_token_id,
)
result = tokenizer.decode(outputs[0], skip_special_tokens=False)
print(result)
In multi-turn conversations, the model can preserve thinking context:
# Conversation with preserved thinking
conversation = [
{"role": "user", "content": "কম্পিউটার কী?"},
{"role": "assistant", "content": "<thinking>...reasoning...</thinking>বৈদ্যুতিক যন্ত্র...</final>"},
{"role": "user", "content": "এর উদাহরণ দাও"},
# Model remembers previous context
]
Enable/disable thinking per request:
# With thinking (complex tasks)
outputs = model.generate(inputs, use_thinking=True)
# Without thinking (simple tasks - faster)
outputs = model.generate(inputs, use_thinking=False)
| Metric | Value |
|---|---|
| Parameters | 23M |
| Thinking Tokens | 6 |
| Max Length | 256 |
To train with thinking data:
python3 sheikh_thinking_finetune.py --train
config.json - Model configuration with thinking token IDstokenizer.json - BPE tokenizer with thinking tokenschat_template.jinja - Chat template supporting thinking blocksmodel.safetensors - Model weights@misc{sheikh-bangla-thinking,
author = {Osama Bin Likhon},
title = {sheikh-bangla-thinking: Bengali GPT-2 with Interleaved Thinking},
url = {https://huggingface.co/OsamaBinLikhon/sheikh-bangla-thinking},
}