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 30
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:7530ce03c31041753706d5a18f58f1c38a2644a6984b48efc2c33b5ec2c7427e
|
| 3 |
size 15882477500
|
runs/May02_07-37-51_computeinstance-u00tsvencz52xt97bk/events.out.tfevents.1777707471.computeinstance-u00tsvencz52xt97bk.50799.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:192c574417e68aeb8e4bc63708722341fc2f9c93132e45c53b0df13a104cc4cb
|
| 3 |
+
size 13122
|