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 6000, 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:a9e0275bab1a6a9782df65a6f8abfba7e17a82295a2cbdb95725d3f45b1e28a0
|
| 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:412e90b7208921d172da8d70bcf2d9eb483f1ba3bacdde12388ae0f1699757ba
|
| 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:3c4bb3232333245cce0402989a808fbb8a3484f7c8d0a74db5b1f083ad707d43
|
| 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:6af98c8a00430bf78cf7a33095a269f67cf12c82df483a872be441460ebbbf74
|
| 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:1e49e65fc711539cf4a80289687bb7ae73d6c8503caf26e61f786d781a7e51b3
|
| 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,
|
|
@@ -866,6 +866,84 @@
|
|
| 866 |
"eval_samples_per_second": 49.321,
|
| 867 |
"eval_steps_per_second": 1.543,
|
| 868 |
"step": 5500
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 869 |
}
|
| 870 |
],
|
| 871 |
"logging_steps": 50,
|
|
@@ -885,7 +963,7 @@
|
|
| 885 |
"attributes": {}
|
| 886 |
}
|
| 887 |
},
|
| 888 |
-
"total_flos":
|
| 889 |
"train_batch_size": 32,
|
| 890 |
"trial_name": null,
|
| 891 |
"trial_params": null
|
|
|
|
| 2 |
"best_global_step": null,
|
| 3 |
"best_metric": null,
|
| 4 |
"best_model_checkpoint": null,
|
| 5 |
+
"epoch": 0.7058823529411765,
|
| 6 |
"eval_steps": 500,
|
| 7 |
+
"global_step": 6000,
|
| 8 |
"is_hyper_param_search": false,
|
| 9 |
"is_local_process_zero": true,
|
| 10 |
"is_world_process_zero": true,
|
|
|
|
| 866 |
"eval_samples_per_second": 49.321,
|
| 867 |
"eval_steps_per_second": 1.543,
|
| 868 |
"step": 5500
|
| 869 |
+
},
|
| 870 |
+
{
|
| 871 |
+
"epoch": 0.6529411764705882,
|
| 872 |
+
"grad_norm": 0.34363728761672974,
|
| 873 |
+
"learning_rate": 0.00017358823529411765,
|
| 874 |
+
"loss": 3.5676690673828126,
|
| 875 |
+
"step": 5550
|
| 876 |
+
},
|
| 877 |
+
{
|
| 878 |
+
"epoch": 0.6588235294117647,
|
| 879 |
+
"grad_norm": 0.3821636736392975,
|
| 880 |
+
"learning_rate": 0.00017064705882352942,
|
| 881 |
+
"loss": 3.564356384277344,
|
| 882 |
+
"step": 5600
|
| 883 |
+
},
|
| 884 |
+
{
|
| 885 |
+
"epoch": 0.6647058823529411,
|
| 886 |
+
"grad_norm": 0.3870471715927124,
|
| 887 |
+
"learning_rate": 0.00016770588235294118,
|
| 888 |
+
"loss": 3.5735037231445315,
|
| 889 |
+
"step": 5650
|
| 890 |
+
},
|
| 891 |
+
{
|
| 892 |
+
"epoch": 0.6705882352941176,
|
| 893 |
+
"grad_norm": 0.3668818175792694,
|
| 894 |
+
"learning_rate": 0.00016476470588235295,
|
| 895 |
+
"loss": 3.5546405029296877,
|
| 896 |
+
"step": 5700
|
| 897 |
+
},
|
| 898 |
+
{
|
| 899 |
+
"epoch": 0.6764705882352942,
|
| 900 |
+
"grad_norm": 0.34516939520835876,
|
| 901 |
+
"learning_rate": 0.0001618235294117647,
|
| 902 |
+
"loss": 3.5730084228515624,
|
| 903 |
+
"step": 5750
|
| 904 |
+
},
|
| 905 |
+
{
|
| 906 |
+
"epoch": 0.6823529411764706,
|
| 907 |
+
"grad_norm": 0.3682394325733185,
|
| 908 |
+
"learning_rate": 0.00015888235294117648,
|
| 909 |
+
"loss": 3.54217529296875,
|
| 910 |
+
"step": 5800
|
| 911 |
+
},
|
| 912 |
+
{
|
| 913 |
+
"epoch": 0.6882352941176471,
|
| 914 |
+
"grad_norm": 0.37805479764938354,
|
| 915 |
+
"learning_rate": 0.0001559411764705882,
|
| 916 |
+
"loss": 3.55981201171875,
|
| 917 |
+
"step": 5850
|
| 918 |
+
},
|
| 919 |
+
{
|
| 920 |
+
"epoch": 0.6941176470588235,
|
| 921 |
+
"grad_norm": 0.3545401990413666,
|
| 922 |
+
"learning_rate": 0.000153,
|
| 923 |
+
"loss": 3.494635009765625,
|
| 924 |
+
"step": 5900
|
| 925 |
+
},
|
| 926 |
+
{
|
| 927 |
+
"epoch": 0.7,
|
| 928 |
+
"grad_norm": 0.35230571031570435,
|
| 929 |
+
"learning_rate": 0.00015005882352941177,
|
| 930 |
+
"loss": 3.314564514160156,
|
| 931 |
+
"step": 5950
|
| 932 |
+
},
|
| 933 |
+
{
|
| 934 |
+
"epoch": 0.7058823529411765,
|
| 935 |
+
"grad_norm": 0.3728525638580322,
|
| 936 |
+
"learning_rate": 0.00014711764705882354,
|
| 937 |
+
"loss": 3.292919006347656,
|
| 938 |
+
"step": 6000
|
| 939 |
+
},
|
| 940 |
+
{
|
| 941 |
+
"epoch": 0.7058823529411765,
|
| 942 |
+
"eval_loss": 3.4088094234466553,
|
| 943 |
+
"eval_runtime": 178.0592,
|
| 944 |
+
"eval_samples_per_second": 48.821,
|
| 945 |
+
"eval_steps_per_second": 1.528,
|
| 946 |
+
"step": 6000
|
| 947 |
}
|
| 948 |
],
|
| 949 |
"logging_steps": 50,
|
|
|
|
| 963 |
"attributes": {}
|
| 964 |
}
|
| 965 |
},
|
| 966 |
+
"total_flos": 1.00336140288e+17,
|
| 967 |
"train_batch_size": 32,
|
| 968 |
"trial_name": null,
|
| 969 |
"trial_params": null
|