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
Training in progress, step 55
Browse files
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 15882477500
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d7bc053663ccbaa56d40bf61b6f7824265f62ba7a54d4a8686dff305f570dcf8
|
| 3 |
size 15882477500
|
runs/May02_13-00-57_computeinstance-u00rz0452246qjz66y/events.out.tfevents.1777726857.computeinstance-u00rz0452246qjz66y.24781.0
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7b06ca49726d0e8217c9547e1604791ee14e13a87b0c5ff537059baf140f6928
|
| 3 |
+
size 14157
|