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 8500, 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:df9038fe034db9a047f54c690d06b9114daf20184002362a66632a6acc917267
|
| 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:748571902301cc129d3d670961c825093e36e3bbfcd02dfeb4d96e478d5d2c39
|
| 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:ac39a3789a0a36db49e48938b741df4d9d564ce4af74645a95842f2e1155650b
|
| 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:ad6b24ce4baba0ebc24398b918705f0f0197e697b3b339da567a13464dc9788a
|
| 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:15fd23d03fbf681c8030c1c6b801c1e0af68ea29f95c34bd8f1ed5a61659be76
|
| 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,
|
|
@@ -1256,6 +1256,84 @@
|
|
| 1256 |
"eval_samples_per_second": 49.194,
|
| 1257 |
"eval_steps_per_second": 1.539,
|
| 1258 |
"step": 8000
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1259 |
}
|
| 1260 |
],
|
| 1261 |
"logging_steps": 50,
|
|
@@ -1270,12 +1348,12 @@
|
|
| 1270 |
"should_evaluate": false,
|
| 1271 |
"should_log": false,
|
| 1272 |
"should_save": true,
|
| 1273 |
-
"should_training_stop":
|
| 1274 |
},
|
| 1275 |
"attributes": {}
|
| 1276 |
}
|
| 1277 |
},
|
| 1278 |
-
"total_flos": 1.
|
| 1279 |
"train_batch_size": 32,
|
| 1280 |
"trial_name": null,
|
| 1281 |
"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": 8500,
|
| 8 |
"is_hyper_param_search": false,
|
| 9 |
"is_local_process_zero": true,
|
| 10 |
"is_world_process_zero": true,
|
|
|
|
| 1256 |
"eval_samples_per_second": 49.194,
|
| 1257 |
"eval_steps_per_second": 1.539,
|
| 1258 |
"step": 8000
|
| 1259 |
+
},
|
| 1260 |
+
{
|
| 1261 |
+
"epoch": 0.9470588235294117,
|
| 1262 |
+
"grad_norm": 0.37743404507637024,
|
| 1263 |
+
"learning_rate": 2.6529411764705882e-05,
|
| 1264 |
+
"loss": 3.477872314453125,
|
| 1265 |
+
"step": 8050
|
| 1266 |
+
},
|
| 1267 |
+
{
|
| 1268 |
+
"epoch": 0.9529411764705882,
|
| 1269 |
+
"grad_norm": 0.37343254685401917,
|
| 1270 |
+
"learning_rate": 2.3588235294117647e-05,
|
| 1271 |
+
"loss": 3.266590576171875,
|
| 1272 |
+
"step": 8100
|
| 1273 |
+
},
|
| 1274 |
+
{
|
| 1275 |
+
"epoch": 0.9588235294117647,
|
| 1276 |
+
"grad_norm": 0.3546009957790375,
|
| 1277 |
+
"learning_rate": 2.0647058823529412e-05,
|
| 1278 |
+
"loss": 3.2414059448242187,
|
| 1279 |
+
"step": 8150
|
| 1280 |
+
},
|
| 1281 |
+
{
|
| 1282 |
+
"epoch": 0.9647058823529412,
|
| 1283 |
+
"grad_norm": 0.34603244066238403,
|
| 1284 |
+
"learning_rate": 1.7705882352941177e-05,
|
| 1285 |
+
"loss": 3.3995672607421876,
|
| 1286 |
+
"step": 8200
|
| 1287 |
+
},
|
| 1288 |
+
{
|
| 1289 |
+
"epoch": 0.9705882352941176,
|
| 1290 |
+
"grad_norm": 0.34663328528404236,
|
| 1291 |
+
"learning_rate": 1.4764705882352942e-05,
|
| 1292 |
+
"loss": 3.4866387939453123,
|
| 1293 |
+
"step": 8250
|
| 1294 |
+
},
|
| 1295 |
+
{
|
| 1296 |
+
"epoch": 0.9764705882352941,
|
| 1297 |
+
"grad_norm": 0.3719863295555115,
|
| 1298 |
+
"learning_rate": 1.1823529411764707e-05,
|
| 1299 |
+
"loss": 3.5252374267578124,
|
| 1300 |
+
"step": 8300
|
| 1301 |
+
},
|
| 1302 |
+
{
|
| 1303 |
+
"epoch": 0.9823529411764705,
|
| 1304 |
+
"grad_norm": 0.3406435549259186,
|
| 1305 |
+
"learning_rate": 8.882352941176472e-06,
|
| 1306 |
+
"loss": 3.4751815795898438,
|
| 1307 |
+
"step": 8350
|
| 1308 |
+
},
|
| 1309 |
+
{
|
| 1310 |
+
"epoch": 0.9882352941176471,
|
| 1311 |
+
"grad_norm": 0.34062960743904114,
|
| 1312 |
+
"learning_rate": 5.941176470588235e-06,
|
| 1313 |
+
"loss": 3.493436279296875,
|
| 1314 |
+
"step": 8400
|
| 1315 |
+
},
|
| 1316 |
+
{
|
| 1317 |
+
"epoch": 0.9941176470588236,
|
| 1318 |
+
"grad_norm": 0.34683459997177124,
|
| 1319 |
+
"learning_rate": 3e-06,
|
| 1320 |
+
"loss": 3.49129638671875,
|
| 1321 |
+
"step": 8450
|
| 1322 |
+
},
|
| 1323 |
+
{
|
| 1324 |
+
"epoch": 1.0,
|
| 1325 |
+
"grad_norm": 0.36988383531570435,
|
| 1326 |
+
"learning_rate": 5.882352941176471e-08,
|
| 1327 |
+
"loss": 3.492980651855469,
|
| 1328 |
+
"step": 8500
|
| 1329 |
+
},
|
| 1330 |
+
{
|
| 1331 |
+
"epoch": 1.0,
|
| 1332 |
+
"eval_loss": 3.3368608951568604,
|
| 1333 |
+
"eval_runtime": 177.9297,
|
| 1334 |
+
"eval_samples_per_second": 48.856,
|
| 1335 |
+
"eval_steps_per_second": 1.529,
|
| 1336 |
+
"step": 8500
|
| 1337 |
}
|
| 1338 |
],
|
| 1339 |
"logging_steps": 50,
|
|
|
|
| 1348 |
"should_evaluate": false,
|
| 1349 |
"should_log": false,
|
| 1350 |
"should_save": true,
|
| 1351 |
+
"should_training_stop": true
|
| 1352 |
},
|
| 1353 |
"attributes": {}
|
| 1354 |
}
|
| 1355 |
},
|
| 1356 |
+
"total_flos": 1.42142865408e+17,
|
| 1357 |
"train_batch_size": 32,
|
| 1358 |
"trial_name": null,
|
| 1359 |
"trial_params": null
|