Instructions to use Pamzyy/sinhala_gpt2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Pamzyy/sinhala_gpt2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Pamzyy/sinhala_gpt2")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Pamzyy/sinhala_gpt2") model = AutoModelForCausalLM.from_pretrained("Pamzyy/sinhala_gpt2") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Pamzyy/sinhala_gpt2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Pamzyy/sinhala_gpt2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Pamzyy/sinhala_gpt2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Pamzyy/sinhala_gpt2
- SGLang
How to use Pamzyy/sinhala_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 "Pamzyy/sinhala_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": "Pamzyy/sinhala_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 "Pamzyy/sinhala_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": "Pamzyy/sinhala_gpt2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Pamzyy/sinhala_gpt2 with Docker Model Runner:
docker model run hf.co/Pamzyy/sinhala_gpt2
sinhala_gpt2
This model is a fine-tuned version of gpt2 on the None dataset. It achieves the following results on the evaluation set:
- Loss: 3.4181
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: 5e-06
- train_batch_size: 16
- eval_batch_size: 16
- seed: 42
- gradient_accumulation_steps: 4
- total_train_batch_size: 64
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: cosine
- lr_scheduler_warmup_steps: 10
- num_epochs: 1
Training results
| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| 12.5768 | 0.0737 | 20 | 11.7031 |
| 10.6016 | 0.1475 | 40 | 10.1428 |
| 9.5592 | 0.2212 | 60 | 8.4000 |
| 7.7086 | 0.2949 | 80 | 6.1398 |
| 6.1288 | 0.3687 | 100 | 5.1259 |
| 5.2551 | 0.4424 | 120 | 4.4283 |
| 4.7127 | 0.5161 | 140 | 4.0241 |
| 4.3572 | 0.5899 | 160 | 3.7673 |
| 4.1243 | 0.6636 | 180 | 3.6012 |
| 3.9714 | 0.7373 | 200 | 3.5126 |
| 3.8867 | 0.8111 | 220 | 3.4489 |
| 3.8334 | 0.8848 | 240 | 3.4256 |
| 3.8204 | 0.9585 | 260 | 3.4181 |
Framework versions
- Transformers 4.44.2
- Pytorch 2.4.0+cu121
- Datasets 2.21.0
- Tokenizers 0.19.1
- Downloads last month
- 4
Model tree for Pamzyy/sinhala_gpt2
Base model
openai-community/gpt2