Instructions to use OpensourceThai/Wilai with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use OpensourceThai/Wilai with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="OpensourceThai/Wilai", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("OpensourceThai/Wilai", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use OpensourceThai/Wilai with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "OpensourceThai/Wilai" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "OpensourceThai/Wilai", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/OpensourceThai/Wilai
- SGLang
How to use OpensourceThai/Wilai 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 "OpensourceThai/Wilai" \ --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": "OpensourceThai/Wilai", "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 "OpensourceThai/Wilai" \ --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": "OpensourceThai/Wilai", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use OpensourceThai/Wilai with Docker Model Runner:
docker model run hf.co/OpensourceThai/Wilai
Commit History
-
Create generation_config.json
Verified signatureadebe54 -
Delete generation_config.json
Verified signature8fb61cc -
Upload generation_config.json with huggingface_hub
Verified signature7ece4d5 -
Upload config.json with huggingface_hub
Verified signature75e868b -
Upload configuration_openthaiwilai.py with huggingface_hub
Verified signaturebf725a9 -
Update config.json
Verified signature3de8a14 -
Create __init__.py
Verified signature5e42bb3 -
Update config.json
Verified signature6d3df85 -
Create modeling_openthaiwilai.py
Verified signature4ee78f9 -
Create configuration_openthaiwilai.py
Verified signature6d304c6 -
Create config.json
Verified signature7b30f68 -
Upload generation_config.json with huggingface_hub
Verified signature6996700 -
Upload training_args.bin with huggingface_hub
Verified signature2135c70 -
Upload pytorch_model.bin with huggingface_hub
Verified signature88e19a7 -
Upload config.json with huggingface_hub
Verified signature22be2e9 -
Upload tokenizer
Verified signature3c05ad4 -
initial commit
Verified signature1f185a3