Instructions to use BharatVLM/AssameseGPT2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use BharatVLM/AssameseGPT2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="BharatVLM/AssameseGPT2")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("BharatVLM/AssameseGPT2") model = AutoModelForCausalLM.from_pretrained("BharatVLM/AssameseGPT2") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use BharatVLM/AssameseGPT2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "BharatVLM/AssameseGPT2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "BharatVLM/AssameseGPT2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/BharatVLM/AssameseGPT2
- SGLang
How to use BharatVLM/AssameseGPT2 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 "BharatVLM/AssameseGPT2" \ --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": "BharatVLM/AssameseGPT2", "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 "BharatVLM/AssameseGPT2" \ --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": "BharatVLM/AssameseGPT2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use BharatVLM/AssameseGPT2 with Docker Model Runner:
docker model run hf.co/BharatVLM/AssameseGPT2
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("BharatVLM/AssameseGPT2")
model = AutoModelForCausalLM.from_pretrained("BharatVLM/AssameseGPT2")Assamese GPT-2 Model
This is a GPT-2 language model trained from scratch on Assamese monolingual text, using data from IndicCorpV2 . The model is developed for educational and research purposes to support natural language understanding and generation tasks in Assamese โ a low-resource language.
๐ Model Description
The Assamese GPT-2 model is based on the standard GPT-2 decoder-only transformer architecture with 12 layers, 12 attention heads, 768 hidden size. It is capable of generating grammatically coherent and contextually relevant Assamese text and serves as a foundation for downstream NLP tasks such as:
- Language modeling
- Text completion/generation
- Fine-tuning for classification or summarization
โ Intended Uses
- Academic research on Assamese NLP
- Training and benchmarking in educational settings
- Exploration of low-resource language modeling
๐ซ Limitations
- Trained on general-domain monolingual data, may not perform well on domain-specific texts (e.g., legal, medical).
- Might generate biased, incomplete, or hallucinated outputs.
- Not suitable for production use or deployment in sensitive applications.
๐ Training and Evaluation Data
The model was trained using Assamese monolingual data collected from:
- IndicCorpV2: A curated collection of web-crawled and processed data for Indic languages.
Data preprocessing included:
- Unicode normalization
- Removal of noisy characters and malformed tokens
- Sentence segmentation using Assamese-specific heuristics
๐งช Training Procedure
Hyperparameters
- Architecture: GPT2 (12 layers, 12 heads, 768 hidden size)
- Tokenizer vocab size: 50,000
- Context window size: 1024 tokens
- Learning rate: 5e-5
- Epochs: 20
- Batch size: 64
- Optimizer: AdamW (ฮฒโ=0.9, ฮฒโ=0.999, ฮต=1e-8)
- Scheduler: Linear
- Mixed Precision: Native AMP
- Seed: 42
Results
- Final Evaluation Loss: -29.1890
- Accuracy: 0.3452
๐ Example Usage
from transformers import GPT2LMHeadModel, GPT2Tokenizer
model = GPT2LMHeadModel.from_pretrained("BharatVLM/AssameseGPT2")
tokenizer = GPT2Tokenizer.from_pretrained("BharatVLM/AssameseGPT2")
prompt = "เฆ
เฆธเฆฎเงฐ เฆเฆคเฆฟเฆนเฆพเฆธ"
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_length=50, do_sample=True)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
๐ License
This model is released under the Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0) license. Commercial use is not permitted. Use is allowed for academic and research purposes only.
๐ฌ Citation
Please cite this model as:
@misc{assamesegpt2, author = {BharatVLM}, title = {Assamese GPT-2 Model}, year = 2025, howpublished = {\url{https://huggingface.co/BharatVLM/AssameseGPT2}}, note = {Trained using IndicCorpV2 and OSCAR corpora} }
๐งฐ Framework Versions
Transformers: 4.52.0.dev0
PyTorch: 2.5.1+cu121
Datasets: 3.6.0
Tokenizers: 0.21.1
Contact Us
For questions or academic collaboration, please contact: ai.bharatvlm@gmail.com.
- Downloads last month
- 29
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="BharatVLM/AssameseGPT2")