Instructions to use PranomVignesh/gpt2-sonnet-generators with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use PranomVignesh/gpt2-sonnet-generators with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="PranomVignesh/gpt2-sonnet-generators")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("PranomVignesh/gpt2-sonnet-generators") model = AutoModelForCausalLM.from_pretrained("PranomVignesh/gpt2-sonnet-generators", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use PranomVignesh/gpt2-sonnet-generators with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "PranomVignesh/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": "PranomVignesh/gpt2-sonnet-generators", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/PranomVignesh/gpt2-sonnet-generators
- SGLang
How to use PranomVignesh/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 "PranomVignesh/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": "PranomVignesh/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 "PranomVignesh/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": "PranomVignesh/gpt2-sonnet-generators", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use PranomVignesh/gpt2-sonnet-generators with Docker Model Runner:
docker model run hf.co/PranomVignesh/gpt2-sonnet-generators
Commit History
-
Adding `safetensors` variant of this model (#1)
- Adding `safetensors` variant of this model (8aab8ce990c4737951d8cba926601a4aadcb8b82) Co-authored-by: Safetensors convertbot <SFconvertbot@users.noreply.huggingface.co>7727e30
-
Upload shakespeare.txt with huggingface_hub
90f5b15 -
Upload merges.txt with huggingface_hub
169e762 -
Upload vocab.json with huggingface_hub
876a113 -
Upload added_tokens.json with huggingface_hub
9001981 -
Upload special_tokens_map.json with huggingface_hub
1ddb43f -
Upload tokenizer_config.json with huggingface_hub
774fb6b -
Upload training_args.bin with huggingface_hub
0ffff66 -
Upload pytorch_model.bin with huggingface_hub
0dcbbba -
Upload generation_config.json with huggingface_hub
f5eedd1 -
Upload config.json with huggingface_hub
4853ee6 -
Upload shakespeare.txt.1 with huggingface_hub
f2ac20f
-
initial commit
e065a56