Text Generation
Transformers
TensorBoard
Safetensors
Thai
English
gemma4
image-text-to-text
legal
thai
continued-pretraining
cpt
law
gemma
causal-lm
Instructions to use Phonsiri/Thai-Legal-Gemma-4B-CPT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Phonsiri/Thai-Legal-Gemma-4B-CPT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Phonsiri/Thai-Legal-Gemma-4B-CPT")# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("Phonsiri/Thai-Legal-Gemma-4B-CPT") model = AutoModelForMultimodalLM.from_pretrained("Phonsiri/Thai-Legal-Gemma-4B-CPT", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Phonsiri/Thai-Legal-Gemma-4B-CPT with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Phonsiri/Thai-Legal-Gemma-4B-CPT" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Phonsiri/Thai-Legal-Gemma-4B-CPT", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Phonsiri/Thai-Legal-Gemma-4B-CPT
- SGLang
How to use Phonsiri/Thai-Legal-Gemma-4B-CPT 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 "Phonsiri/Thai-Legal-Gemma-4B-CPT" \ --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": "Phonsiri/Thai-Legal-Gemma-4B-CPT", "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 "Phonsiri/Thai-Legal-Gemma-4B-CPT" \ --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": "Phonsiri/Thai-Legal-Gemma-4B-CPT", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Phonsiri/Thai-Legal-Gemma-4B-CPT with Docker Model Runner:
docker model run hf.co/Phonsiri/Thai-Legal-Gemma-4B-CPT
Ctrl+K
This model has 1 file scanned as unsafe.
- checkpoint-10
- checkpoint-15
- checkpoint-20
- checkpoint-25
- checkpoint-30
- checkpoint-35
- checkpoint-40
- checkpoint-45
- checkpoint-5
- checkpoint-50
- checkpoint-55
- checkpoint-60
- checkpoint-65
- checkpoint-70
- checkpoint-75
- checkpoint-80
- runs
- 1.57 kB
- 8.26 kB
- 5.22 kB
- 193 Bytes
- 15.9 GB xet
- 32.2 MB xet
- 1.53 kB
- 5.27 kB xet