Instructions to use hishab/titulm-mpt-1b-v1.0 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use hishab/titulm-mpt-1b-v1.0 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="hishab/titulm-mpt-1b-v1.0", trust_remote_code=True)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("hishab/titulm-mpt-1b-v1.0", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("hishab/titulm-mpt-1b-v1.0", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use hishab/titulm-mpt-1b-v1.0 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "hishab/titulm-mpt-1b-v1.0" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "hishab/titulm-mpt-1b-v1.0", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/hishab/titulm-mpt-1b-v1.0
- SGLang
How to use hishab/titulm-mpt-1b-v1.0 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "hishab/titulm-mpt-1b-v1.0" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "hishab/titulm-mpt-1b-v1.0", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "hishab/titulm-mpt-1b-v1.0" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "hishab/titulm-mpt-1b-v1.0", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use hishab/titulm-mpt-1b-v1.0 with Docker Model Runner:
docker model run hf.co/hishab/titulm-mpt-1b-v1.0
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("hishab/titulm-mpt-1b-v1.0", trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained("hishab/titulm-mpt-1b-v1.0", trust_remote_code=True, device_map="auto")TituLM-1B-BN-V1
TituLM-1B-BN-V1 is a large language model specifically trained for generating and understanding Bangla text. Utilizing a decoder-style transformer architecture, this model has been extensively trained on a dataset comprising 4.51 billion Bangla tokens. This model is the part of iterative train and release Bangla LLM from Hishab.
Training
The training process was managed using the robust framework provided by MosaicML's llm-foundry repository. Throughout the training phase, titulm-1b-bn-v1 underwent a total of 59 iterations, allowing for iterative refinements and optimization. Notable training configs:
- n_nead: 16
- n_layers: 24
- max_sequence_length: 2048
- vocab_size: 72000
- attn_impl: flash
- Trained on 8 H100 GPU on GCP
Training evaluation status
Evaluation CrossEntropy Loss
Final loss: 3.11
Language Perplexity
Final Perplexity: 22.562

Datasets
We add Bangla text datasets from several sources including
- Culturax
- Books
- Bangla Wikipedia
- Banglapedia
- News articles
Our total data size is 58 GB of deduplicated data with 4.51 billion tokens tokenized by our sentencepiece model.
How to Use
The basic use cases to generate text using this model is simple. Follow the below code to generate text using this model.
Install the following library before running the code:
pip install transformers
pip install einops
pip install accelerate
import transformers
from transformers import pipeline
model_name = 'hishab/titulm-1b-bn-v1'
config = transformers.AutoConfig.from_pretrained(model_name, trust_remote_code=True)
config.max_seq_len = 2048
model = transformers.AutoModelForCausalLM.from_pretrained(
model_name,
config=config,
trust_remote_code=True
)
tokenizer = transformers.AutoTokenizer.from_pretrained('hishab/titulm-1b-bn-v1')
pipe = pipeline('text-generation', model=model, tokenizer=tokenizer, device='cuda:0')
output = pipe('আমি বাংলায় গান',
max_new_tokens=100,
do_sample=True,
use_cache=True)
print(output)
Citation
@misc{hishab_2024_titulm_1b_bn_v1,
author = {Hishab Technologies Ltd.},
title = {TituLM-1B-BN-V1},
year = {2024},
publisher = {HuggingFace Models},
howpublished = {https://huggingface.co/hishab/titulm-1b-bn-v1},
}
- Downloads last month
- 78
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="hishab/titulm-mpt-1b-v1.0", trust_remote_code=True)