Text Generation
Transformers
PyTorch
JAX
Vietnamese
gpt2
vietnamese
lm
nlp
text-generation-inference
Instructions to use NlpHUST/gpt2-vietnamese with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use NlpHUST/gpt2-vietnamese with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="NlpHUST/gpt2-vietnamese")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("NlpHUST/gpt2-vietnamese") model = AutoModelForCausalLM.from_pretrained("NlpHUST/gpt2-vietnamese", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use NlpHUST/gpt2-vietnamese with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "NlpHUST/gpt2-vietnamese" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "NlpHUST/gpt2-vietnamese", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/NlpHUST/gpt2-vietnamese
- SGLang
How to use NlpHUST/gpt2-vietnamese 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 "NlpHUST/gpt2-vietnamese" \ --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": "NlpHUST/gpt2-vietnamese", "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 "NlpHUST/gpt2-vietnamese" \ --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": "NlpHUST/gpt2-vietnamese", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use NlpHUST/gpt2-vietnamese with Docker Model Runner:
docker model run hf.co/NlpHUST/gpt2-vietnamese
Commit History
-
Saving weights and logs of step 150000
126d503 -
Saving weights and logs of step 147500
1e9b55a -
Saving weights and logs of step 145000
8fe630d -
Saving weights and logs of step 142500
48c0db8 -
Saving weights and logs of step 140000
18d5915 -
Saving weights and logs of step 137500
fe0c5c1 -
Saving weights and logs of step 135000
9eed208 -
Saving weights and logs of step 132500
463b70a
-
Saving weights and logs of step 130000
949c30d -
Saving weights and logs of step 127500
e2695d2 -
Saving weights and logs of step 125000
ba98f4b -
Saving weights and logs of step 122500
6422b18 -
Saving weights and logs of step 120000
ba33ab3 -
Saving weights and logs of step 117500
9714a2c -
Saving weights and logs of step 115000
c6f8f0e -
Saving weights and logs of step 112500
4d2c080 -
Saving weights and logs of step 110000
7010d1c -
Saving weights and logs of step 107500
bf43885 -
Saving weights and logs of step 105000
390938f -
Saving weights and logs of step 102500
c9efc7c
-
Saving weights and logs of step 100000
5b9c93b -
Saving weights and logs of step 97500
8bbabfd -
Saving weights and logs of step 95000
d92ad4f -
Saving weights and logs of step 92500
0bd6985 -
Saving weights and logs of step 90000
e8755db -
Saving weights and logs of step 87500
28e5192 -
Saving weights and logs of step 85000
d12bcc0 -
Saving weights and logs of step 82500
642c51e -
Saving weights and logs of step 80000
a635d22 -
Saving weights and logs of step 77500
8ce6176 -
Saving weights and logs of step 75000
c764dfe -
Saving weights and logs of step 72500
6d21ee2
-
Saving weights and logs of step 70000
ae1f2c8 -
Saving weights and logs of step 67500
b8464b4 -
Saving weights and logs of step 65000
bdc64bd -
Saving weights and logs of step 62500
f055753 -
Saving weights and logs of step 60000
4e4b4c0 -
Saving weights and logs of step 57500
b7f3519 -
Saving weights and logs of step 55000
65a8e4b -
Saving weights and logs of step 52500
bf3e1d0 -
Saving weights and logs of step 50000
0b69dd3 -
Saving weights and logs of step 47500
b00ebac -
Saving weights and logs of step 45000
6b701df -
Saving weights and logs of step 42500
1fda378
-
Saving weights and logs of step 40000
8b42685 -
Saving weights and logs of step 37500
905e3df -
Saving weights and logs of step 35000
48fb416 -
Saving weights and logs of step 32500
a40c2f9 -
Saving weights and logs of step 30000
55455ce -
Saving weights and logs of step 27500
e12820e