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 5, checkpoint
Browse files- checkpoint-5/model.safetensors +1 -1
- checkpoint-5/optimizer.pt +2 -2
- checkpoint-5/trainer_state.json +10 -10
- checkpoint-5/training_args.bin +1 -1
checkpoint-5/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:c89f27c9d1d6030019bbd9bdca903c0058caf0d2d669d52988caae636ca788fd
|
| 3 |
size 15882477500
|
checkpoint-5/optimizer.pt
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:516bdab405d08a9b56b268d753e0ee6751bb9209aa9923edf1ca32bf6746eff8
|
| 3 |
+
size 29852609572
|
checkpoint-5/trainer_state.json
CHANGED
|
@@ -11,37 +11,37 @@
|
|
| 11 |
"log_history": [
|
| 12 |
{
|
| 13 |
"epoch": 0.010485357362277289,
|
| 14 |
-
"grad_norm":
|
| 15 |
"learning_rate": 0.0,
|
| 16 |
-
"loss": 1.
|
| 17 |
"step": 1
|
| 18 |
},
|
| 19 |
{
|
| 20 |
"epoch": 0.020970714724554577,
|
| 21 |
-
"grad_norm":
|
| 22 |
"learning_rate": 4e-08,
|
| 23 |
-
"loss": 1.
|
| 24 |
"step": 2
|
| 25 |
},
|
| 26 |
{
|
| 27 |
"epoch": 0.03145607208683186,
|
| 28 |
-
"grad_norm":
|
| 29 |
"learning_rate": 8e-08,
|
| 30 |
-
"loss": 1.
|
| 31 |
"step": 3
|
| 32 |
},
|
| 33 |
{
|
| 34 |
"epoch": 0.041941429449109155,
|
| 35 |
-
"grad_norm":
|
| 36 |
"learning_rate": 1.2000000000000002e-07,
|
| 37 |
-
"loss": 1.
|
| 38 |
"step": 4
|
| 39 |
},
|
| 40 |
{
|
| 41 |
"epoch": 0.05242678681138644,
|
| 42 |
-
"grad_norm":
|
| 43 |
"learning_rate": 1.6e-07,
|
| 44 |
-
"loss": 1.
|
| 45 |
"step": 5
|
| 46 |
}
|
| 47 |
],
|
|
|
|
| 11 |
"log_history": [
|
| 12 |
{
|
| 13 |
"epoch": 0.010485357362277289,
|
| 14 |
+
"grad_norm": 498.0,
|
| 15 |
"learning_rate": 0.0,
|
| 16 |
+
"loss": 1.6033425331115723,
|
| 17 |
"step": 1
|
| 18 |
},
|
| 19 |
{
|
| 20 |
"epoch": 0.020970714724554577,
|
| 21 |
+
"grad_norm": 139.0,
|
| 22 |
"learning_rate": 4e-08,
|
| 23 |
+
"loss": 1.5843058824539185,
|
| 24 |
"step": 2
|
| 25 |
},
|
| 26 |
{
|
| 27 |
"epoch": 0.03145607208683186,
|
| 28 |
+
"grad_norm": 158.0,
|
| 29 |
"learning_rate": 8e-08,
|
| 30 |
+
"loss": 1.624650239944458,
|
| 31 |
"step": 3
|
| 32 |
},
|
| 33 |
{
|
| 34 |
"epoch": 0.041941429449109155,
|
| 35 |
+
"grad_norm": 201.0,
|
| 36 |
"learning_rate": 1.2000000000000002e-07,
|
| 37 |
+
"loss": 1.5930713415145874,
|
| 38 |
"step": 4
|
| 39 |
},
|
| 40 |
{
|
| 41 |
"epoch": 0.05242678681138644,
|
| 42 |
+
"grad_norm": 1392.0,
|
| 43 |
"learning_rate": 1.6e-07,
|
| 44 |
+
"loss": 1.6284583806991577,
|
| 45 |
"step": 5
|
| 46 |
}
|
| 47 |
],
|
checkpoint-5/training_args.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 5265
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:874ac4b635f5e0e0130ccc11de5bfc6cee2eac14aa65567d5f9737b0b5cc556a
|
| 3 |
size 5265
|