Text Generation
Transformers
TensorBoard
Safetensors
gpt2
Generated from Trainer
text-generation-inference
Instructions to use Anish13/pretrained_gpt2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Anish13/pretrained_gpt2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Anish13/pretrained_gpt2")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Anish13/pretrained_gpt2") model = AutoModelForCausalLM.from_pretrained("Anish13/pretrained_gpt2") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use Anish13/pretrained_gpt2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Anish13/pretrained_gpt2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Anish13/pretrained_gpt2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Anish13/pretrained_gpt2
- SGLang
How to use Anish13/pretrained_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 "Anish13/pretrained_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": "Anish13/pretrained_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 "Anish13/pretrained_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": "Anish13/pretrained_gpt2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Anish13/pretrained_gpt2 with Docker Model Runner:
docker model run hf.co/Anish13/pretrained_gpt2
Ctrl+K
- Feb04_23-17-07_nlp-gpu-01.be.ucsc.edu
- Feb05_02-43-07_nlp-gpu-01.be.ucsc.edu
- Feb05_10-08-19_nlp-gpu-01.be.ucsc.edu
- Feb05_12-35-26_nlp-gpu-01.be.ucsc.edu
- Feb05_14-35-28_nlp-gpu-01.be.ucsc.edu
- Feb05_14-41-37_nlp-gpu-01.be.ucsc.edu
- Feb05_14-45-26_nlp-gpu-01.be.ucsc.edu
- Feb05_14-45-50_nlp-gpu-01.be.ucsc.edu
- Feb05_14-47-35_nlp-gpu-01.be.ucsc.edu
- Feb05_15-11-26_nlp-gpu-01.be.ucsc.edu
- Feb05_15-28-41_nlp-gpu-01.be.ucsc.edu
- Feb05_15-29-07_nlp-gpu-01.be.ucsc.edu
- Feb05_17-11-31_nlp-gpu-01.be.ucsc.edu
- Feb05_17-11-42_nlp-gpu-01.be.ucsc.edu
- Feb05_17-12-02_nlp-gpu-01.be.ucsc.edu
- Feb05_17-12-10_nlp-gpu-01.be.ucsc.edu
- Feb05_17-22-35_nlp-gpu-01.be.ucsc.edu
- Feb05_17-39-44_nlp-gpu-01.be.ucsc.edu
- Feb05_17-39-56_nlp-gpu-01.be.ucsc.edu
- Feb05_17-40-14_nlp-gpu-01.be.ucsc.edu
- Feb05_17-42-29_nlp-gpu-01.be.ucsc.edu
- Feb05_17-51-27_nlp-gpu-01.be.ucsc.edu
- Feb05_17-54-42_nlp-gpu-01.be.ucsc.edu
- Feb05_17-56-37_nlp-gpu-01.be.ucsc.edu
- Feb05_17-57-22_nlp-gpu-01.be.ucsc.edu
- Feb05_22-21-31_nlp-gpu-01.be.ucsc.edu
- Feb05_22-29-41_nlp-gpu-01.be.ucsc.edu
- Feb05_22-55-03_nlp-gpu-01.be.ucsc.edu
- Feb05_23-28-14_nlp-gpu-01.be.ucsc.edu
- Feb05_23-35-53_nlp-gpu-01.be.ucsc.edu
- Feb05_23-39-22_nlp-gpu-01.be.ucsc.edu
- Feb05_23-41-47_nlp-gpu-01.be.ucsc.edu
- Feb05_23-43-00_nlp-gpu-01.be.ucsc.edu
- Feb05_23-45-54_nlp-gpu-01.be.ucsc.edu
- Feb05_23-46-13_nlp-gpu-01.be.ucsc.edu
- Feb05_23-46-57_nlp-gpu-01.be.ucsc.edu
- Feb05_23-47-33_nlp-gpu-01.be.ucsc.edu
- Feb05_23-48-12_nlp-gpu-01.be.ucsc.edu
- Feb05_23-48-54_nlp-gpu-01.be.ucsc.edu
- Feb05_23-50-22_nlp-gpu-01.be.ucsc.edu
- Feb05_23-51-08_nlp-gpu-01.be.ucsc.edu
- Feb05_23-51-28_nlp-gpu-01.be.ucsc.edu
- Feb06_00-03-49_nlp-gpu-01.be.ucsc.edu
- Feb06_00-34-12_nlp-gpu-01.be.ucsc.edu
- Feb06_22-19-45_nlp-gpu-01.be.ucsc.edu
- Feb07_20-37-04_nlp-gpu-01.be.ucsc.edu
- Feb07_20-38-27_nlp-gpu-01.be.ucsc.edu
- Feb07_21-26-23_nlp-gpu-01.be.ucsc.edu
- Feb08_12-43-44_nlp-gpu-01.be.ucsc.edu
- Feb08_12-44-41_nlp-gpu-01.be.ucsc.edu