Text Generation
Transformers
PyTorch
TensorBoard
Safetensors
gpt2
Generated from Trainer
text-generation-inference
Instructions to use kkboy1/gpt2-trained with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use kkboy1/gpt2-trained with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="kkboy1/gpt2-trained")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("kkboy1/gpt2-trained") model = AutoModelForCausalLM.from_pretrained("kkboy1/gpt2-trained", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use kkboy1/gpt2-trained with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "kkboy1/gpt2-trained" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "kkboy1/gpt2-trained", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/kkboy1/gpt2-trained
- SGLang
How to use kkboy1/gpt2-trained 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 "kkboy1/gpt2-trained" \ --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": "kkboy1/gpt2-trained", "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 "kkboy1/gpt2-trained" \ --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": "kkboy1/gpt2-trained", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use kkboy1/gpt2-trained with Docker Model Runner:
docker model run hf.co/kkboy1/gpt2-trained
Commit History
-
End of training
7fd8661 -
Model save
f553e51
-
End of training
8a447f3 -
Model save
ba51152 -
Training in progress, step 500
cc4020e
-
End of training
dfeb837 -
Model save
f93a9a6 -
Training in progress, step 2000
7b64052 -
Training in progress, step 1500
5da3e91 -
Training in progress, step 1000
d35e894 -
Training in progress, step 500
a51351e -
End of training
8a7bc72 -
Model save
ee33040 -
Training in progress, step 500
73f5695 -
End of training
6c42eb5 -
Model save
177a62d -
End of training
b21d6cc -
Model save
3f18f6b
-
Upload 9 files
9028390 -
Create README.md
013a344 -
initial commit
f140deb