Text Generation
Transformers
PyTorch
TensorFlow
JAX
TensorBoard
Sinhala
gpt2
feature-extraction
Sinhala
text-generation-inference
Instructions to use keshan/sinhala-gpt2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use keshan/sinhala-gpt2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="keshan/sinhala-gpt2")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("keshan/sinhala-gpt2") model = AutoModel.from_pretrained("keshan/sinhala-gpt2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use keshan/sinhala-gpt2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "keshan/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": "keshan/sinhala-gpt2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/keshan/sinhala-gpt2
- SGLang
How to use keshan/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 "keshan/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": "keshan/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 "keshan/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": "keshan/sinhala-gpt2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use keshan/sinhala-gpt2 with Docker Model Runner:
docker model run hf.co/keshan/sinhala-gpt2
Commit History
-
Saving weights and logs of step 95000
b103f1b -
Saving weights and logs of step 92500
acd439d -
Saving weights and logs of step 90000
918e01c -
Saving weights and logs of step 87500
18bf88d -
Saving weights and logs of step 85000
95ae85f -
Saving weights and logs of step 82500
c7f630a -
Saving weights and logs of step 80000
5250535 -
Saving weights and logs of step 77500
ae506c9 -
Saving weights and logs of step 75000
9fd3f62 -
Saving weights and logs of step 72500
29c943a -
Saving weights and logs of step 70000
14cf847 -
Saving weights and logs of step 67500
bdd4301 -
Saving weights and logs of step 65000
2498110 -
Saving weights and logs of step 62500
ee1c487 -
Saving weights and logs of step 60000
feda334 -
Saving weights and logs of step 57500
4db5262 -
Saving weights and logs of step 55000
4b7c4b8 -
Saving weights and logs of step 52500
e54979a -
Saving weights and logs of step 50000
13371fc -
Saving weights and logs of step 47500
4fef2e6 -
Saving weights and logs of step 45000
52c9c2a -
Saving weights and logs of step 42500
0364b22 -
Saving weights and logs of step 40000
436ed51 -
Saving weights and logs of step 37500
bc05a0c -
Saving weights and logs of step 35000
5f31ddd -
Saving weights and logs of step 32500
4d74c07 -
Saving weights and logs of step 30000
5cadf65 -
Saving weights and logs of step 27500
f119059 -
Saving weights and logs of step 25000
dd986c9
-
Saving weights and logs of step 22500
0180156 -
Saving weights and logs of step 20000
e59f572 -
Saving weights and logs of step 17500
7954909 -
Saving weights and logs of step 15000
c6e363f -
Saving weights and logs of step 12500
f835350 -
Saving weights and logs of step 10000
5d15c0e -
Saving weights and logs of step 7500
cf60e87 -
Saving weights and logs of step 5000
ee4a4ab -
Saving weights and logs of step 2500
5ec59a6 -
Saving weights and logs of step 10
5339b17