legacy-datasets/wikipedia
Updated • 125k • 630
How to use Suchinthana/sinhala-gpt-neo-siwiki with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="Suchinthana/sinhala-gpt-neo-siwiki") # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("Suchinthana/sinhala-gpt-neo-siwiki")
model = AutoModelForCausalLM.from_pretrained("Suchinthana/sinhala-gpt-neo-siwiki")How to use Suchinthana/sinhala-gpt-neo-siwiki with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "Suchinthana/sinhala-gpt-neo-siwiki"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "Suchinthana/sinhala-gpt-neo-siwiki",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/Suchinthana/sinhala-gpt-neo-siwiki
How to use Suchinthana/sinhala-gpt-neo-siwiki with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "Suchinthana/sinhala-gpt-neo-siwiki" \
--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": "Suchinthana/sinhala-gpt-neo-siwiki",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'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 "Suchinthana/sinhala-gpt-neo-siwiki" \
--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": "Suchinthana/sinhala-gpt-neo-siwiki",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use Suchinthana/sinhala-gpt-neo-siwiki with Docker Model Runner:
docker model run hf.co/Suchinthana/sinhala-gpt-neo-siwiki
This model is fine tuned with acrticles from Sinhala Wikipedia Dataset for Sinhala text generation. Only the articles with word count in between 60 and 500 were used here.
You can use this model directly with a pipeline for text generation. This example generates a different sequence each time it's run:
>>> from transformers import pipeline
>>> generator = pipeline('text-generation', model='Suchinthana/sinhala-gpt-neo-siwiki')
>>> generator("නිර්මාණය කිරීම සඳහා ", do_sample=True, max_length=500)