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 6500, 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:44e5337b3e0214b4729f349032988a9b03806846f7f4bd6d268aef041b459c52
|
| 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:59fe147cb04454b19d7862577b716d215f62ea0d638e3a53e231ac5e1783553f
|
| 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:4eb312d65febc64758e9d1fe191e5c3c93cd8ec224be66347404eb3503c7f723
|
| 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:1bd42e357d6b98cb9bff543c6a4f4b9f46ab579a827a6b5d2df5dd5d499424c0
|
| 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:3bfe8ee0b406625e2e6930efb21c3d4599f197be5d04a29012b92920efae4631
|
| 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,
|
|
@@ -944,6 +944,84 @@
|
|
| 944 |
"eval_samples_per_second": 48.821,
|
| 945 |
"eval_steps_per_second": 1.528,
|
| 946 |
"step": 6000
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 947 |
}
|
| 948 |
],
|
| 949 |
"logging_steps": 50,
|
|
@@ -963,7 +1041,7 @@
|
|
| 963 |
"attributes": {}
|
| 964 |
}
|
| 965 |
},
|
| 966 |
-
"total_flos": 1.
|
| 967 |
"train_batch_size": 32,
|
| 968 |
"trial_name": null,
|
| 969 |
"trial_params": null
|
|
|
|
| 2 |
"best_global_step": null,
|
| 3 |
"best_metric": null,
|
| 4 |
"best_model_checkpoint": null,
|
| 5 |
+
"epoch": 0.7647058823529411,
|
| 6 |
"eval_steps": 500,
|
| 7 |
+
"global_step": 6500,
|
| 8 |
"is_hyper_param_search": false,
|
| 9 |
"is_local_process_zero": true,
|
| 10 |
"is_world_process_zero": true,
|
|
|
|
| 944 |
"eval_samples_per_second": 48.821,
|
| 945 |
"eval_steps_per_second": 1.528,
|
| 946 |
"step": 6000
|
| 947 |
+
},
|
| 948 |
+
{
|
| 949 |
+
"epoch": 0.711764705882353,
|
| 950 |
+
"grad_norm": 0.3450179696083069,
|
| 951 |
+
"learning_rate": 0.0001441764705882353,
|
| 952 |
+
"loss": 3.5081927490234377,
|
| 953 |
+
"step": 6050
|
| 954 |
+
},
|
| 955 |
+
{
|
| 956 |
+
"epoch": 0.7176470588235294,
|
| 957 |
+
"grad_norm": 0.3508113920688629,
|
| 958 |
+
"learning_rate": 0.00014123529411764707,
|
| 959 |
+
"loss": 3.5310910034179686,
|
| 960 |
+
"step": 6100
|
| 961 |
+
},
|
| 962 |
+
{
|
| 963 |
+
"epoch": 0.7235294117647059,
|
| 964 |
+
"grad_norm": 0.35503652691841125,
|
| 965 |
+
"learning_rate": 0.00013829411764705883,
|
| 966 |
+
"loss": 3.542174072265625,
|
| 967 |
+
"step": 6150
|
| 968 |
+
},
|
| 969 |
+
{
|
| 970 |
+
"epoch": 0.7294117647058823,
|
| 971 |
+
"grad_norm": 0.3807806074619293,
|
| 972 |
+
"learning_rate": 0.0001353529411764706,
|
| 973 |
+
"loss": 3.5378152465820314,
|
| 974 |
+
"step": 6200
|
| 975 |
+
},
|
| 976 |
+
{
|
| 977 |
+
"epoch": 0.7352941176470589,
|
| 978 |
+
"grad_norm": 0.3575717508792877,
|
| 979 |
+
"learning_rate": 0.00013241176470588233,
|
| 980 |
+
"loss": 3.327708740234375,
|
| 981 |
+
"step": 6250
|
| 982 |
+
},
|
| 983 |
+
{
|
| 984 |
+
"epoch": 0.7411764705882353,
|
| 985 |
+
"grad_norm": 0.34574732184410095,
|
| 986 |
+
"learning_rate": 0.00012947058823529413,
|
| 987 |
+
"loss": 3.2896099853515626,
|
| 988 |
+
"step": 6300
|
| 989 |
+
},
|
| 990 |
+
{
|
| 991 |
+
"epoch": 0.7470588235294118,
|
| 992 |
+
"grad_norm": 0.3618618845939636,
|
| 993 |
+
"learning_rate": 0.0001265294117647059,
|
| 994 |
+
"loss": 3.4104681396484375,
|
| 995 |
+
"step": 6350
|
| 996 |
+
},
|
| 997 |
+
{
|
| 998 |
+
"epoch": 0.7529411764705882,
|
| 999 |
+
"grad_norm": 0.39512887597084045,
|
| 1000 |
+
"learning_rate": 0.00012358823529411766,
|
| 1001 |
+
"loss": 3.5210690307617187,
|
| 1002 |
+
"step": 6400
|
| 1003 |
+
},
|
| 1004 |
+
{
|
| 1005 |
+
"epoch": 0.7588235294117647,
|
| 1006 |
+
"grad_norm": 0.36507633328437805,
|
| 1007 |
+
"learning_rate": 0.00012064705882352942,
|
| 1008 |
+
"loss": 3.5360977172851564,
|
| 1009 |
+
"step": 6450
|
| 1010 |
+
},
|
| 1011 |
+
{
|
| 1012 |
+
"epoch": 0.7647058823529411,
|
| 1013 |
+
"grad_norm": 0.3706028461456299,
|
| 1014 |
+
"learning_rate": 0.00011770588235294117,
|
| 1015 |
+
"loss": 3.5502828979492187,
|
| 1016 |
+
"step": 6500
|
| 1017 |
+
},
|
| 1018 |
+
{
|
| 1019 |
+
"epoch": 0.7647058823529411,
|
| 1020 |
+
"eval_loss": 3.3835549354553223,
|
| 1021 |
+
"eval_runtime": 175.4441,
|
| 1022 |
+
"eval_samples_per_second": 49.549,
|
| 1023 |
+
"eval_steps_per_second": 1.55,
|
| 1024 |
+
"step": 6500
|
| 1025 |
}
|
| 1026 |
],
|
| 1027 |
"logging_steps": 50,
|
|
|
|
| 1041 |
"attributes": {}
|
| 1042 |
}
|
| 1043 |
},
|
| 1044 |
+
"total_flos": 1.08697485312e+17,
|
| 1045 |
"train_batch_size": 32,
|
| 1046 |
"trial_name": null,
|
| 1047 |
"trial_params": null
|