Instructions to use shahidul034/text_generation_bangla_model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use shahidul034/text_generation_bangla_model with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="shahidul034/text_generation_bangla_model")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("shahidul034/text_generation_bangla_model") model = AutoModelForCausalLM.from_pretrained("shahidul034/text_generation_bangla_model") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use shahidul034/text_generation_bangla_model with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "shahidul034/text_generation_bangla_model" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "shahidul034/text_generation_bangla_model", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/shahidul034/text_generation_bangla_model
- SGLang
How to use shahidul034/text_generation_bangla_model 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 "shahidul034/text_generation_bangla_model" \ --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": "shahidul034/text_generation_bangla_model", "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 "shahidul034/text_generation_bangla_model" \ --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": "shahidul034/text_generation_bangla_model", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use shahidul034/text_generation_bangla_model with Docker Model Runner:
docker model run hf.co/shahidul034/text_generation_bangla_model
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("shahidul034/text_generation_bangla_model")
model = AutoModelForCausalLM.from_pretrained("shahidul034/text_generation_bangla_model")YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
text_generation_bangla_model
BanglaCLM dataset:
OSCAR: 12.84GB
Wikipedia dump: 6.24GB
ProthomAlo: 3.92GB
Kalerkantho: 3.24GB
Model description
- context size : 128
Training and evaluation data
The BanglaCLM data set is divided into a training set (90%)and a validation set (10%).
Training procedure
Training hyperparameters
The following hyperparameters were used during training:
Batch size: 32
Initial learning rate: 5e-5
Number of warmup steps: 10000
Weight decay rate: 0.01
Tokenization algorithm: BPE
Vocabulary size of tokenizer: 50256
Total trainable params: 124,439,808
Epochs: 40
Number of training steps: 40772228
training_precision: float32
Training results
perplexity score: 2.86.
Framework versions
- Transformers 4.26.1
- TensorFlow 2.11.0
- Datasets 2.10.0
- Tokenizers 0.13.2
Citation
If you find this model helpful, please cite.
@INPROCEEDINGS{10303383,
author={Salim, Md. Shahidul and Murad, Hasan and Das, Dola and Ahmed, Faisal},
booktitle={2023 International Conference on Information and Communication Technology for Sustainable Development (ICICT4SD)},
title={BanglaGPT: A Generative Pretrained Transformer-Based Model for Bangla Language},
year={2023},
volume={},
number={},
pages={56-59},
doi={10.1109/ICICT4SD59951.2023.10303383}}
- Downloads last month
- 4
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="shahidul034/text_generation_bangla_model")