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 7500, 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:95b216ca2f0f331cd0fb1b5060aae7303e018fd811a626e11c3f50b85f075124
|
| 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:730fa392e5f88931f6f53528627829ab93c230c150c53ca715559afeb980893d
|
| 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:9ccaae7b7094e3f6ae09519a1d8593eea1044e5a091df08ba92284c2a368db5a
|
| 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:67e9e63342c9fc618c8284b5217646e8560302dc68c6c23a6c0fc311b7d330bf
|
| 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:e6847feb481bac2207bbdccaefe424c80456cc08ed8d62eb651573dfcd4ddaea
|
| 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,
|
|
@@ -1100,6 +1100,84 @@
|
|
| 1100 |
"eval_samples_per_second": 49.195,
|
| 1101 |
"eval_steps_per_second": 1.539,
|
| 1102 |
"step": 7000
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1103 |
}
|
| 1104 |
],
|
| 1105 |
"logging_steps": 50,
|
|
@@ -1119,7 +1197,7 @@
|
|
| 1119 |
"attributes": {}
|
| 1120 |
}
|
| 1121 |
},
|
| 1122 |
-
"total_flos": 1.
|
| 1123 |
"train_batch_size": 32,
|
| 1124 |
"trial_name": null,
|
| 1125 |
"trial_params": null
|
|
|
|
| 2 |
"best_global_step": null,
|
| 3 |
"best_metric": null,
|
| 4 |
"best_model_checkpoint": null,
|
| 5 |
+
"epoch": 0.8823529411764706,
|
| 6 |
"eval_steps": 500,
|
| 7 |
+
"global_step": 7500,
|
| 8 |
"is_hyper_param_search": false,
|
| 9 |
"is_local_process_zero": true,
|
| 10 |
"is_world_process_zero": true,
|
|
|
|
| 1100 |
"eval_samples_per_second": 49.195,
|
| 1101 |
"eval_steps_per_second": 1.539,
|
| 1102 |
"step": 7000
|
| 1103 |
+
},
|
| 1104 |
+
{
|
| 1105 |
+
"epoch": 0.8294117647058824,
|
| 1106 |
+
"grad_norm": 0.37701481580734253,
|
| 1107 |
+
"learning_rate": 8.535294117647059e-05,
|
| 1108 |
+
"loss": 3.5055966186523437,
|
| 1109 |
+
"step": 7050
|
| 1110 |
+
},
|
| 1111 |
+
{
|
| 1112 |
+
"epoch": 0.8352941176470589,
|
| 1113 |
+
"grad_norm": 0.4007062017917633,
|
| 1114 |
+
"learning_rate": 8.241176470588235e-05,
|
| 1115 |
+
"loss": 3.533425598144531,
|
| 1116 |
+
"step": 7100
|
| 1117 |
+
},
|
| 1118 |
+
{
|
| 1119 |
+
"epoch": 0.8411764705882353,
|
| 1120 |
+
"grad_norm": 0.3913261294364929,
|
| 1121 |
+
"learning_rate": 7.947058823529412e-05,
|
| 1122 |
+
"loss": 3.515142822265625,
|
| 1123 |
+
"step": 7150
|
| 1124 |
+
},
|
| 1125 |
+
{
|
| 1126 |
+
"epoch": 0.8470588235294118,
|
| 1127 |
+
"grad_norm": 0.38521477580070496,
|
| 1128 |
+
"learning_rate": 7.65294117647059e-05,
|
| 1129 |
+
"loss": 3.5471871948242186,
|
| 1130 |
+
"step": 7200
|
| 1131 |
+
},
|
| 1132 |
+
{
|
| 1133 |
+
"epoch": 0.8529411764705882,
|
| 1134 |
+
"grad_norm": 0.35928088426589966,
|
| 1135 |
+
"learning_rate": 7.358823529411765e-05,
|
| 1136 |
+
"loss": 3.512651062011719,
|
| 1137 |
+
"step": 7250
|
| 1138 |
+
},
|
| 1139 |
+
{
|
| 1140 |
+
"epoch": 0.8588235294117647,
|
| 1141 |
+
"grad_norm": 0.37140655517578125,
|
| 1142 |
+
"learning_rate": 7.064705882352941e-05,
|
| 1143 |
+
"loss": 3.5302188110351564,
|
| 1144 |
+
"step": 7300
|
| 1145 |
+
},
|
| 1146 |
+
{
|
| 1147 |
+
"epoch": 0.8647058823529412,
|
| 1148 |
+
"grad_norm": 0.36203840374946594,
|
| 1149 |
+
"learning_rate": 6.770588235294118e-05,
|
| 1150 |
+
"loss": 3.5184359741210938,
|
| 1151 |
+
"step": 7350
|
| 1152 |
+
},
|
| 1153 |
+
{
|
| 1154 |
+
"epoch": 0.8705882352941177,
|
| 1155 |
+
"grad_norm": 0.35999393463134766,
|
| 1156 |
+
"learning_rate": 6.476470588235295e-05,
|
| 1157 |
+
"loss": 3.506470031738281,
|
| 1158 |
+
"step": 7400
|
| 1159 |
+
},
|
| 1160 |
+
{
|
| 1161 |
+
"epoch": 0.8764705882352941,
|
| 1162 |
+
"grad_norm": 0.3602432608604431,
|
| 1163 |
+
"learning_rate": 6.18235294117647e-05,
|
| 1164 |
+
"loss": 3.4295809936523436,
|
| 1165 |
+
"step": 7450
|
| 1166 |
+
},
|
| 1167 |
+
{
|
| 1168 |
+
"epoch": 0.8823529411764706,
|
| 1169 |
+
"grad_norm": 0.3545781075954437,
|
| 1170 |
+
"learning_rate": 5.888235294117647e-05,
|
| 1171 |
+
"loss": 3.2766519165039063,
|
| 1172 |
+
"step": 7500
|
| 1173 |
+
},
|
| 1174 |
+
{
|
| 1175 |
+
"epoch": 0.8823529411764706,
|
| 1176 |
+
"eval_loss": 3.3576905727386475,
|
| 1177 |
+
"eval_runtime": 175.7349,
|
| 1178 |
+
"eval_samples_per_second": 49.467,
|
| 1179 |
+
"eval_steps_per_second": 1.548,
|
| 1180 |
+
"step": 7500
|
| 1181 |
}
|
| 1182 |
],
|
| 1183 |
"logging_steps": 50,
|
|
|
|
| 1197 |
"attributes": {}
|
| 1198 |
}
|
| 1199 |
},
|
| 1200 |
+
"total_flos": 1.2542017536e+17,
|
| 1201 |
"train_batch_size": 32,
|
| 1202 |
"trial_name": null,
|
| 1203 |
"trial_params": null
|