Text Generation
Transformers
TensorBoard
Safetensors
gpt2
Generated from Trainer
text-generation-inference
Instructions to use sushant-iit/hindi_gpt2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sushant-iit/hindi_gpt2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="sushant-iit/hindi_gpt2")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("sushant-iit/hindi_gpt2") model = AutoModelForCausalLM.from_pretrained("sushant-iit/hindi_gpt2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use sushant-iit/hindi_gpt2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "sushant-iit/hindi_gpt2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sushant-iit/hindi_gpt2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/sushant-iit/hindi_gpt2
- SGLang
How to use sushant-iit/hindi_gpt2 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 "sushant-iit/hindi_gpt2" \ --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": "sushant-iit/hindi_gpt2", "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 "sushant-iit/hindi_gpt2" \ --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": "sushant-iit/hindi_gpt2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use sushant-iit/hindi_gpt2 with Docker Model Runner:
docker model run hf.co/sushant-iit/hindi_gpt2
hindi_gpt2
This model is a fine-tuned version of gpt2 on the None dataset. It achieves the following results on the evaluation set:
- Loss: 1.9772
Model description
More information needed
Intended uses & limitations
More information needed
Training and evaluation data
More information needed
Training procedure
Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 0.0005
- train_batch_size: 64
- eval_batch_size: 64
- seed: 42
- gradient_accumulation_steps: 4
- total_train_batch_size: 256
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: cosine
- lr_scheduler_warmup_steps: 500
- num_epochs: 8
Training results
| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| 4.9843 | 0.48 | 500 | 3.1384 |
| 2.7769 | 0.95 | 1000 | 2.5036 |
| 2.4479 | 1.43 | 1500 | 2.3352 |
| 2.3239 | 1.9 | 2000 | 2.2456 |
| 2.2272 | 2.38 | 2500 | 2.1854 |
| 2.1782 | 2.86 | 3000 | 2.1405 |
| 2.1102 | 3.33 | 3500 | 2.1053 |
| 2.0774 | 3.81 | 4000 | 2.0731 |
| 2.0276 | 4.29 | 4500 | 2.0551 |
| 1.9978 | 4.76 | 5000 | 2.0267 |
| 1.9624 | 5.24 | 5500 | 2.0143 |
| 1.9351 | 5.71 | 6000 | 1.9955 |
| 1.914 | 6.19 | 6500 | 1.9894 |
| 1.8886 | 6.67 | 7000 | 1.9807 |
| 1.8806 | 7.14 | 7500 | 1.9780 |
| 1.8692 | 7.62 | 8000 | 1.9772 |
Framework versions
- Transformers 4.39.3
- Pytorch 2.4.0.dev20240415
- Datasets 2.18.0
- Tokenizers 0.15.2
- Downloads last month
- 13
Model tree for sushant-iit/hindi_gpt2
Base model
openai-community/gpt2