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 8000, 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:d70198e690533c8705cb606a2f8554e9c88db3919bc157b0b85cfd40b9163cdf
|
| 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:f09de07399f3f34149aed6397af707e189d23d41a5d5df6968ab6e71d7d2629a
|
| 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:ff6f17e3eb221fe462edccd50497bde0f3a71571ed479a52a41576181171c931
|
| 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:a95554cb3d06aec9d05e31c8207a60744e94359015aa846162464c9cdf88bcec
|
| 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:fef1bbe15ebf93cd14ffe46ac40b68f1ba1e52a58545c7076dbc53cd30fcde1a
|
| 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": 0.
|
| 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,
|
|
@@ -1178,6 +1178,84 @@
|
|
| 1178 |
"eval_samples_per_second": 49.467,
|
| 1179 |
"eval_steps_per_second": 1.548,
|
| 1180 |
"step": 7500
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1181 |
}
|
| 1182 |
],
|
| 1183 |
"logging_steps": 50,
|
|
@@ -1197,7 +1275,7 @@
|
|
| 1197 |
"attributes": {}
|
| 1198 |
}
|
| 1199 |
},
|
| 1200 |
-
"total_flos": 1.
|
| 1201 |
"train_batch_size": 32,
|
| 1202 |
"trial_name": null,
|
| 1203 |
"trial_params": null
|
|
|
|
| 2 |
"best_global_step": null,
|
| 3 |
"best_metric": null,
|
| 4 |
"best_model_checkpoint": null,
|
| 5 |
+
"epoch": 0.9411764705882353,
|
| 6 |
"eval_steps": 500,
|
| 7 |
+
"global_step": 8000,
|
| 8 |
"is_hyper_param_search": false,
|
| 9 |
"is_local_process_zero": true,
|
| 10 |
"is_world_process_zero": true,
|
|
|
|
| 1178 |
"eval_samples_per_second": 49.467,
|
| 1179 |
"eval_steps_per_second": 1.548,
|
| 1180 |
"step": 7500
|
| 1181 |
+
},
|
| 1182 |
+
{
|
| 1183 |
+
"epoch": 0.888235294117647,
|
| 1184 |
+
"grad_norm": 0.3486090898513794,
|
| 1185 |
+
"learning_rate": 5.5941176470588236e-05,
|
| 1186 |
+
"loss": 3.2706234741210936,
|
| 1187 |
+
"step": 7550
|
| 1188 |
+
},
|
| 1189 |
+
{
|
| 1190 |
+
"epoch": 0.8941176470588236,
|
| 1191 |
+
"grad_norm": 0.3703632950782776,
|
| 1192 |
+
"learning_rate": 5.3e-05,
|
| 1193 |
+
"loss": 3.465188293457031,
|
| 1194 |
+
"step": 7600
|
| 1195 |
+
},
|
| 1196 |
+
{
|
| 1197 |
+
"epoch": 0.9,
|
| 1198 |
+
"grad_norm": 0.3537668287754059,
|
| 1199 |
+
"learning_rate": 5.0058823529411766e-05,
|
| 1200 |
+
"loss": 3.487032470703125,
|
| 1201 |
+
"step": 7650
|
| 1202 |
+
},
|
| 1203 |
+
{
|
| 1204 |
+
"epoch": 0.9058823529411765,
|
| 1205 |
+
"grad_norm": 0.3689066171646118,
|
| 1206 |
+
"learning_rate": 4.711764705882353e-05,
|
| 1207 |
+
"loss": 3.5042953491210938,
|
| 1208 |
+
"step": 7700
|
| 1209 |
+
},
|
| 1210 |
+
{
|
| 1211 |
+
"epoch": 0.9117647058823529,
|
| 1212 |
+
"grad_norm": 0.3667464256286621,
|
| 1213 |
+
"learning_rate": 4.4176470588235296e-05,
|
| 1214 |
+
"loss": 3.527998962402344,
|
| 1215 |
+
"step": 7750
|
| 1216 |
+
},
|
| 1217 |
+
{
|
| 1218 |
+
"epoch": 0.9176470588235294,
|
| 1219 |
+
"grad_norm": 0.36605432629585266,
|
| 1220 |
+
"learning_rate": 4.123529411764706e-05,
|
| 1221 |
+
"loss": 3.484926452636719,
|
| 1222 |
+
"step": 7800
|
| 1223 |
+
},
|
| 1224 |
+
{
|
| 1225 |
+
"epoch": 0.9235294117647059,
|
| 1226 |
+
"grad_norm": 0.3601936101913452,
|
| 1227 |
+
"learning_rate": 3.8294117647058826e-05,
|
| 1228 |
+
"loss": 3.4993707275390626,
|
| 1229 |
+
"step": 7850
|
| 1230 |
+
},
|
| 1231 |
+
{
|
| 1232 |
+
"epoch": 0.9294117647058824,
|
| 1233 |
+
"grad_norm": 0.35972827672958374,
|
| 1234 |
+
"learning_rate": 3.535294117647059e-05,
|
| 1235 |
+
"loss": 3.5094595336914063,
|
| 1236 |
+
"step": 7900
|
| 1237 |
+
},
|
| 1238 |
+
{
|
| 1239 |
+
"epoch": 0.9352941176470588,
|
| 1240 |
+
"grad_norm": 0.4135211706161499,
|
| 1241 |
+
"learning_rate": 3.2411764705882356e-05,
|
| 1242 |
+
"loss": 3.512149658203125,
|
| 1243 |
+
"step": 7950
|
| 1244 |
+
},
|
| 1245 |
+
{
|
| 1246 |
+
"epoch": 0.9411764705882353,
|
| 1247 |
+
"grad_norm": 0.33782321214675903,
|
| 1248 |
+
"learning_rate": 2.9470588235294117e-05,
|
| 1249 |
+
"loss": 3.491231689453125,
|
| 1250 |
+
"step": 8000
|
| 1251 |
+
},
|
| 1252 |
+
{
|
| 1253 |
+
"epoch": 0.9411764705882353,
|
| 1254 |
+
"eval_loss": 3.343282461166382,
|
| 1255 |
+
"eval_runtime": 176.7083,
|
| 1256 |
+
"eval_samples_per_second": 49.194,
|
| 1257 |
+
"eval_steps_per_second": 1.539,
|
| 1258 |
+
"step": 8000
|
| 1259 |
}
|
| 1260 |
],
|
| 1261 |
"logging_steps": 50,
|
|
|
|
| 1275 |
"attributes": {}
|
| 1276 |
}
|
| 1277 |
},
|
| 1278 |
+
"total_flos": 1.33781520384e+17,
|
| 1279 |
"train_batch_size": 32,
|
| 1280 |
"trial_name": null,
|
| 1281 |
"trial_params": null
|