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 7000, 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:a082886572e13067532489a5fc1dcb98c513570df4676ae62b39ded1c25bb7e4
|
| 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:72a510a1be1e74db7c7d7a99d3f3d239298e6879c992b42b0e0f01ea7eacdb9b
|
| 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:5a3c0e5c96be49e3d0f56967ef3a66294b8033a429d896ba1c57076548eb65a4
|
| 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:6a68ceae7165f4c88c8c4809f6ef958049408efc4229565cd13a1f7800728538
|
| 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:d119247b2cee9414eefc7d0552fb04c1f86b7b19685ed262e23f9b9c7cf23594
|
| 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,
|
|
@@ -1022,6 +1022,84 @@
|
|
| 1022 |
"eval_samples_per_second": 49.549,
|
| 1023 |
"eval_steps_per_second": 1.55,
|
| 1024 |
"step": 6500
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1025 |
}
|
| 1026 |
],
|
| 1027 |
"logging_steps": 50,
|
|
@@ -1041,7 +1119,7 @@
|
|
| 1041 |
"attributes": {}
|
| 1042 |
}
|
| 1043 |
},
|
| 1044 |
-
"total_flos": 1.
|
| 1045 |
"train_batch_size": 32,
|
| 1046 |
"trial_name": null,
|
| 1047 |
"trial_params": null
|
|
|
|
| 2 |
"best_global_step": null,
|
| 3 |
"best_metric": null,
|
| 4 |
"best_model_checkpoint": null,
|
| 5 |
+
"epoch": 0.8235294117647058,
|
| 6 |
"eval_steps": 500,
|
| 7 |
+
"global_step": 7000,
|
| 8 |
"is_hyper_param_search": false,
|
| 9 |
"is_local_process_zero": true,
|
| 10 |
"is_world_process_zero": true,
|
|
|
|
| 1022 |
"eval_samples_per_second": 49.549,
|
| 1023 |
"eval_steps_per_second": 1.55,
|
| 1024 |
"step": 6500
|
| 1025 |
+
},
|
| 1026 |
+
{
|
| 1027 |
+
"epoch": 0.7705882352941177,
|
| 1028 |
+
"grad_norm": 0.3573964536190033,
|
| 1029 |
+
"learning_rate": 0.00011476470588235294,
|
| 1030 |
+
"loss": 3.5397024536132813,
|
| 1031 |
+
"step": 6550
|
| 1032 |
+
},
|
| 1033 |
+
{
|
| 1034 |
+
"epoch": 0.7764705882352941,
|
| 1035 |
+
"grad_norm": 0.3719513416290283,
|
| 1036 |
+
"learning_rate": 0.00011182352941176472,
|
| 1037 |
+
"loss": 3.5319180297851562,
|
| 1038 |
+
"step": 6600
|
| 1039 |
+
},
|
| 1040 |
+
{
|
| 1041 |
+
"epoch": 0.7823529411764706,
|
| 1042 |
+
"grad_norm": 0.3488079905509949,
|
| 1043 |
+
"learning_rate": 0.00010888235294117648,
|
| 1044 |
+
"loss": 3.525909118652344,
|
| 1045 |
+
"step": 6650
|
| 1046 |
+
},
|
| 1047 |
+
{
|
| 1048 |
+
"epoch": 0.788235294117647,
|
| 1049 |
+
"grad_norm": 0.378339022397995,
|
| 1050 |
+
"learning_rate": 0.00010594117647058823,
|
| 1051 |
+
"loss": 3.5297225952148437,
|
| 1052 |
+
"step": 6700
|
| 1053 |
+
},
|
| 1054 |
+
{
|
| 1055 |
+
"epoch": 0.7941176470588235,
|
| 1056 |
+
"grad_norm": 0.3940635919570923,
|
| 1057 |
+
"learning_rate": 0.000103,
|
| 1058 |
+
"loss": 3.544861145019531,
|
| 1059 |
+
"step": 6750
|
| 1060 |
+
},
|
| 1061 |
+
{
|
| 1062 |
+
"epoch": 0.8,
|
| 1063 |
+
"grad_norm": 0.36259767413139343,
|
| 1064 |
+
"learning_rate": 0.00010005882352941177,
|
| 1065 |
+
"loss": 3.5146881103515626,
|
| 1066 |
+
"step": 6800
|
| 1067 |
+
},
|
| 1068 |
+
{
|
| 1069 |
+
"epoch": 0.8058823529411765,
|
| 1070 |
+
"grad_norm": 0.35855287313461304,
|
| 1071 |
+
"learning_rate": 9.711764705882353e-05,
|
| 1072 |
+
"loss": 3.4209246826171875,
|
| 1073 |
+
"step": 6850
|
| 1074 |
+
},
|
| 1075 |
+
{
|
| 1076 |
+
"epoch": 0.8117647058823529,
|
| 1077 |
+
"grad_norm": 0.3636466860771179,
|
| 1078 |
+
"learning_rate": 9.417647058823529e-05,
|
| 1079 |
+
"loss": 3.268857421875,
|
| 1080 |
+
"step": 6900
|
| 1081 |
+
},
|
| 1082 |
+
{
|
| 1083 |
+
"epoch": 0.8176470588235294,
|
| 1084 |
+
"grad_norm": 0.36832499504089355,
|
| 1085 |
+
"learning_rate": 9.123529411764706e-05,
|
| 1086 |
+
"loss": 3.299452209472656,
|
| 1087 |
+
"step": 6950
|
| 1088 |
+
},
|
| 1089 |
+
{
|
| 1090 |
+
"epoch": 0.8235294117647058,
|
| 1091 |
+
"grad_norm": 0.3607626259326935,
|
| 1092 |
+
"learning_rate": 8.829411764705883e-05,
|
| 1093 |
+
"loss": 3.5039678955078126,
|
| 1094 |
+
"step": 7000
|
| 1095 |
+
},
|
| 1096 |
+
{
|
| 1097 |
+
"epoch": 0.8235294117647058,
|
| 1098 |
+
"eval_loss": 3.3713526725769043,
|
| 1099 |
+
"eval_runtime": 176.7042,
|
| 1100 |
+
"eval_samples_per_second": 49.195,
|
| 1101 |
+
"eval_steps_per_second": 1.539,
|
| 1102 |
+
"step": 7000
|
| 1103 |
}
|
| 1104 |
],
|
| 1105 |
"logging_steps": 50,
|
|
|
|
| 1119 |
"attributes": {}
|
| 1120 |
}
|
| 1121 |
},
|
| 1122 |
+
"total_flos": 1.17058830336e+17,
|
| 1123 |
"train_batch_size": 32,
|
| 1124 |
"trial_name": null,
|
| 1125 |
"trial_params": null
|