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
Huấn luyện GPT-2 Giai đoạn 3 hoàn tất!
Browse files
README.md
CHANGED
|
@@ -15,7 +15,7 @@ should probably proofread and complete it, then remove this comment. -->
|
|
| 15 |
|
| 16 |
This model is a fine-tuned version of [nmthien/vietnamese-gpt2](https://huggingface.co/nmthien/vietnamese-gpt2) on an unknown dataset.
|
| 17 |
It achieves the following results on the evaluation set:
|
| 18 |
-
- Loss: 3.
|
| 19 |
|
| 20 |
## Model description
|
| 21 |
|
|
@@ -34,7 +34,7 @@ More information needed
|
|
| 34 |
### Training hyperparameters
|
| 35 |
|
| 36 |
The following hyperparameters were used during training:
|
| 37 |
-
- learning_rate: 0.
|
| 38 |
- train_batch_size: 32
|
| 39 |
- eval_batch_size: 32
|
| 40 |
- seed: 42
|
|
@@ -42,30 +42,15 @@ The following hyperparameters were used during training:
|
|
| 42 |
- total_train_batch_size: 64
|
| 43 |
- optimizer: Use OptimizerNames.ADAMW_TORCH_FUSED with betas=(0.9,0.95) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
|
| 44 |
- lr_scheduler_type: linear
|
| 45 |
-
- training_steps:
|
| 46 |
- mixed_precision_training: Native AMP
|
| 47 |
|
| 48 |
### Training results
|
| 49 |
|
| 50 |
-
| Training Loss | Epoch
|
| 51 |
-
|:-------------:|:-----
|
| 52 |
-
| 3.
|
| 53 |
-
| 3.
|
| 54 |
-
| 3.4973 | 0.1765 | 1500 | 3.3372 |
|
| 55 |
-
| 3.4828 | 0.2353 | 2000 | 3.3177 |
|
| 56 |
-
| 3.4430 | 0.2941 | 2500 | 3.3018 |
|
| 57 |
-
| 3.4253 | 0.3529 | 3000 | 3.2942 |
|
| 58 |
-
| 3.1815 | 0.4118 | 3500 | 3.2779 |
|
| 59 |
-
| 3.3987 | 0.4706 | 4000 | 3.2571 |
|
| 60 |
-
| 3.3880 | 0.5294 | 4500 | 3.2480 |
|
| 61 |
-
| 3.3874 | 0.5882 | 5000 | 3.2358 |
|
| 62 |
-
| 3.3513 | 0.6471 | 5500 | 3.2270 |
|
| 63 |
-
| 3.1959 | 0.7059 | 6000 | 3.2200 |
|
| 64 |
-
| 3.2546 | 0.7647 | 6500 | 3.2125 |
|
| 65 |
-
| 3.3710 | 0.8235 | 7000 | 3.2022 |
|
| 66 |
-
| 3.3520 | 0.8824 | 7500 | 3.1959 |
|
| 67 |
-
| 3.3398 | 0.9412 | 8000 | 3.1909 |
|
| 68 |
-
| 3.3247 | 1.0 | 8500 | 3.1891 |
|
| 69 |
|
| 70 |
|
| 71 |
### Framework versions
|
|
|
|
| 15 |
|
| 16 |
This model is a fine-tuned version of [nmthien/vietnamese-gpt2](https://huggingface.co/nmthien/vietnamese-gpt2) on an unknown dataset.
|
| 17 |
It achieves the following results on the evaluation set:
|
| 18 |
+
- Loss: 3.1731
|
| 19 |
|
| 20 |
## Model description
|
| 21 |
|
|
|
|
| 34 |
### Training hyperparameters
|
| 35 |
|
| 36 |
The following hyperparameters were used during training:
|
| 37 |
+
- learning_rate: 0.0002
|
| 38 |
- train_batch_size: 32
|
| 39 |
- eval_batch_size: 32
|
| 40 |
- seed: 42
|
|
|
|
| 42 |
- total_train_batch_size: 64
|
| 43 |
- optimizer: Use OptimizerNames.ADAMW_TORCH_FUSED with betas=(0.9,0.95) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
|
| 44 |
- lr_scheduler_type: linear
|
| 45 |
+
- training_steps: 1000
|
| 46 |
- mixed_precision_training: Native AMP
|
| 47 |
|
| 48 |
### Training results
|
| 49 |
|
| 50 |
+
| Training Loss | Epoch | Step | Validation Loss |
|
| 51 |
+
|:-------------:|:-----:|:----:|:---------------:|
|
| 52 |
+
| 3.3452 | 0.5 | 500 | 3.1901 |
|
| 53 |
+
| 3.3344 | 1.0 | 1000 | 3.1731 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
|
| 55 |
|
| 56 |
### Framework versions
|