Instructions to use dhand33p/gpt2-sonnet-generators with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use dhand33p/gpt2-sonnet-generators with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="dhand33p/gpt2-sonnet-generators")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("dhand33p/gpt2-sonnet-generators") model = AutoModelForCausalLM.from_pretrained("dhand33p/gpt2-sonnet-generators", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use dhand33p/gpt2-sonnet-generators with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "dhand33p/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": "dhand33p/gpt2-sonnet-generators", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/dhand33p/gpt2-sonnet-generators
- SGLang
How to use dhand33p/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 "dhand33p/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": "dhand33p/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 "dhand33p/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": "dhand33p/gpt2-sonnet-generators", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use dhand33p/gpt2-sonnet-generators with Docker Model Runner:
docker model run hf.co/dhand33p/gpt2-sonnet-generators
Commit History
-
Upload merges.txt with huggingface_hub
ea743af -
Upload vocab.json with huggingface_hub
dc809a5 -
Upload added_tokens.json with huggingface_hub
e909455 -
Upload special_tokens_map.json with huggingface_hub
6441cc6 -
Upload tokenizer_config.json with huggingface_hub
a28df3c -
Upload training_args.bin with huggingface_hub
f22db79 -
Upload pytorch_model.bin with huggingface_hub
4fcc192 -
Upload generation_config.json with huggingface_hub
a3041df -
Upload config.json with huggingface_hub
ba12ce3 -
Upload shakespeare.txt with huggingface_hub
6235d77 -
initial commit
a048856