Instructions to use nmthien/vietnamese-gpt2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nmthien/vietnamese-gpt2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="nmthien/vietnamese-gpt2")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("nmthien/vietnamese-gpt2") model = AutoModelForCausalLM.from_pretrained("nmthien/vietnamese-gpt2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use nmthien/vietnamese-gpt2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "nmthien/vietnamese-gpt2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nmthien/vietnamese-gpt2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/nmthien/vietnamese-gpt2
- SGLang
How to use nmthien/vietnamese-gpt2 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 "nmthien/vietnamese-gpt2" \ --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": "nmthien/vietnamese-gpt2", "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 "nmthien/vietnamese-gpt2" \ --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": "nmthien/vietnamese-gpt2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use nmthien/vietnamese-gpt2 with Docker Model Runner:
docker model run hf.co/nmthien/vietnamese-gpt2
Training in progress, step 1000, checkpoint
Browse files
last-checkpoint/model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 441688704
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b91623e2083a021d2a847f58e433bf6b162a7981b87d91d848b5225bca3958c6
|
| 3 |
size 441688704
|
last-checkpoint/optimizer.pt
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 883473803
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:47bdf519d96aa74e9c715546ec1a1288bd59b6143e44665732ac5391e10312c3
|
| 3 |
size 883473803
|
last-checkpoint/rng_state.pth
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 14645
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7fd87c7bd588cc407326020fcfa893af0bcddb350137a0abab09d5d4b782eb66
|
| 3 |
size 14645
|
last-checkpoint/scaler.pt
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 1383
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:14ae2a2128444abab378aa06c09a61a84665f758fcc19fc46f5789b0bc1b5665
|
| 3 |
size 1383
|
last-checkpoint/scheduler.pt
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 1465
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ada16671df03ce2c4c7b2196578593f96e5a9638c91cc68f984858ec0e816498
|
| 3 |
size 1465
|
last-checkpoint/trainer_state.json
CHANGED
|
@@ -2,9 +2,9 @@
|
|
| 2 |
"best_global_step": null,
|
| 3 |
"best_metric": null,
|
| 4 |
"best_model_checkpoint": null,
|
| 5 |
-
"epoch":
|
| 6 |
"eval_steps": 500,
|
| 7 |
-
"global_step":
|
| 8 |
"is_hyper_param_search": false,
|
| 9 |
"is_local_process_zero": true,
|
| 10 |
"is_world_process_zero": true,
|
|
@@ -86,6 +86,84 @@
|
|
| 86 |
"eval_samples_per_second": 43.697,
|
| 87 |
"eval_steps_per_second": 1.37,
|
| 88 |
"step": 500
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 89 |
}
|
| 90 |
],
|
| 91 |
"logging_steps": 50,
|
|
@@ -100,12 +178,12 @@
|
|
| 100 |
"should_evaluate": false,
|
| 101 |
"should_log": false,
|
| 102 |
"should_save": true,
|
| 103 |
-
"should_training_stop":
|
| 104 |
},
|
| 105 |
"attributes": {}
|
| 106 |
}
|
| 107 |
},
|
| 108 |
-
"total_flos":
|
| 109 |
"train_batch_size": 32,
|
| 110 |
"trial_name": null,
|
| 111 |
"trial_params": null
|
|
|
|
| 2 |
"best_global_step": null,
|
| 3 |
"best_metric": null,
|
| 4 |
"best_model_checkpoint": null,
|
| 5 |
+
"epoch": 1.0,
|
| 6 |
"eval_steps": 500,
|
| 7 |
+
"global_step": 1000,
|
| 8 |
"is_hyper_param_search": false,
|
| 9 |
"is_local_process_zero": true,
|
| 10 |
"is_world_process_zero": true,
|
|
|
|
| 86 |
"eval_samples_per_second": 43.697,
|
| 87 |
"eval_steps_per_second": 1.37,
|
| 88 |
"step": 500
|
| 89 |
+
},
|
| 90 |
+
{
|
| 91 |
+
"epoch": 0.55,
|
| 92 |
+
"grad_norm": 0.3327743709087372,
|
| 93 |
+
"learning_rate": 9.020000000000001e-05,
|
| 94 |
+
"loss": 3.3641653442382813,
|
| 95 |
+
"step": 550
|
| 96 |
+
},
|
| 97 |
+
{
|
| 98 |
+
"epoch": 0.6,
|
| 99 |
+
"grad_norm": 0.3543381094932556,
|
| 100 |
+
"learning_rate": 8.020000000000001e-05,
|
| 101 |
+
"loss": 3.343744812011719,
|
| 102 |
+
"step": 600
|
| 103 |
+
},
|
| 104 |
+
{
|
| 105 |
+
"epoch": 0.65,
|
| 106 |
+
"grad_norm": 0.3211086094379425,
|
| 107 |
+
"learning_rate": 7.02e-05,
|
| 108 |
+
"loss": 3.1690444946289062,
|
| 109 |
+
"step": 650
|
| 110 |
+
},
|
| 111 |
+
{
|
| 112 |
+
"epoch": 0.7,
|
| 113 |
+
"grad_norm": 0.3273960053920746,
|
| 114 |
+
"learning_rate": 6.02e-05,
|
| 115 |
+
"loss": 3.1066433715820314,
|
| 116 |
+
"step": 700
|
| 117 |
+
},
|
| 118 |
+
{
|
| 119 |
+
"epoch": 0.75,
|
| 120 |
+
"grad_norm": 0.3205295503139496,
|
| 121 |
+
"learning_rate": 5.02e-05,
|
| 122 |
+
"loss": 3.2476007080078126,
|
| 123 |
+
"step": 750
|
| 124 |
+
},
|
| 125 |
+
{
|
| 126 |
+
"epoch": 0.8,
|
| 127 |
+
"grad_norm": 0.3276917338371277,
|
| 128 |
+
"learning_rate": 4.02e-05,
|
| 129 |
+
"loss": 3.3101565551757814,
|
| 130 |
+
"step": 800
|
| 131 |
+
},
|
| 132 |
+
{
|
| 133 |
+
"epoch": 0.85,
|
| 134 |
+
"grad_norm": 0.3194756805896759,
|
| 135 |
+
"learning_rate": 3.02e-05,
|
| 136 |
+
"loss": 3.332541198730469,
|
| 137 |
+
"step": 850
|
| 138 |
+
},
|
| 139 |
+
{
|
| 140 |
+
"epoch": 0.9,
|
| 141 |
+
"grad_norm": 0.3311285674571991,
|
| 142 |
+
"learning_rate": 2.0200000000000003e-05,
|
| 143 |
+
"loss": 3.340621032714844,
|
| 144 |
+
"step": 900
|
| 145 |
+
},
|
| 146 |
+
{
|
| 147 |
+
"epoch": 0.95,
|
| 148 |
+
"grad_norm": 0.32693082094192505,
|
| 149 |
+
"learning_rate": 1.02e-05,
|
| 150 |
+
"loss": 3.3452032470703124,
|
| 151 |
+
"step": 950
|
| 152 |
+
},
|
| 153 |
+
{
|
| 154 |
+
"epoch": 1.0,
|
| 155 |
+
"grad_norm": 0.32115134596824646,
|
| 156 |
+
"learning_rate": 2.0000000000000002e-07,
|
| 157 |
+
"loss": 3.334386901855469,
|
| 158 |
+
"step": 1000
|
| 159 |
+
},
|
| 160 |
+
{
|
| 161 |
+
"epoch": 1.0,
|
| 162 |
+
"eval_loss": 3.17313551902771,
|
| 163 |
+
"eval_runtime": 192.0422,
|
| 164 |
+
"eval_samples_per_second": 45.188,
|
| 165 |
+
"eval_steps_per_second": 1.416,
|
| 166 |
+
"step": 1000
|
| 167 |
}
|
| 168 |
],
|
| 169 |
"logging_steps": 50,
|
|
|
|
| 178 |
"should_evaluate": false,
|
| 179 |
"should_log": false,
|
| 180 |
"should_save": true,
|
| 181 |
+
"should_training_stop": true
|
| 182 |
},
|
| 183 |
"attributes": {}
|
| 184 |
}
|
| 185 |
},
|
| 186 |
+
"total_flos": 1.6722690048e+16,
|
| 187 |
"train_batch_size": 32,
|
| 188 |
"trial_name": null,
|
| 189 |
"trial_params": null
|