Instructions to use Chetan007/gpt2-sonnet-generators with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Chetan007/gpt2-sonnet-generators with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Chetan007/gpt2-sonnet-generators")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Chetan007/gpt2-sonnet-generators") model = AutoModelForCausalLM.from_pretrained("Chetan007/gpt2-sonnet-generators", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Chetan007/gpt2-sonnet-generators with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Chetan007/gpt2-sonnet-generators" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Chetan007/gpt2-sonnet-generators", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Chetan007/gpt2-sonnet-generators
- SGLang
How to use Chetan007/gpt2-sonnet-generators 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 "Chetan007/gpt2-sonnet-generators" \ --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": "Chetan007/gpt2-sonnet-generators", "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 "Chetan007/gpt2-sonnet-generators" \ --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": "Chetan007/gpt2-sonnet-generators", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Chetan007/gpt2-sonnet-generators with Docker Model Runner:
docker model run hf.co/Chetan007/gpt2-sonnet-generators
Commit History
-
Upload merges.txt with huggingface_hub
9778f7b -
Upload vocab.json with huggingface_hub
2c01c23 -
Upload added_tokens.json with huggingface_hub
79e6281 -
Upload special_tokens_map.json with huggingface_hub
bf3f714 -
Upload tokenizer_config.json with huggingface_hub
bcb0731 -
Upload training_args.bin with huggingface_hub
ba92d4d -
Upload pytorch_model.bin with huggingface_hub
9b961e9 -
Upload generation_config.json with huggingface_hub
c14a76f -
Upload config.json with huggingface_hub
bf782c9 -
Upload shakespeare.txt with huggingface_hub
9ceacce -
Upload generation_config.json with huggingface_hub
cebc01a -
Upload config.json with huggingface_hub
1e94fa0 -
initial commit
210aec7