Instructions to use sgul12/gpt2-sonnet-generators with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sgul12/gpt2-sonnet-generators with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="sgul12/gpt2-sonnet-generators")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("sgul12/gpt2-sonnet-generators") model = AutoModelForCausalLM.from_pretrained("sgul12/gpt2-sonnet-generators", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use sgul12/gpt2-sonnet-generators with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "sgul12/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": "sgul12/gpt2-sonnet-generators", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/sgul12/gpt2-sonnet-generators
- SGLang
How to use sgul12/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 "sgul12/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": "sgul12/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 "sgul12/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": "sgul12/gpt2-sonnet-generators", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use sgul12/gpt2-sonnet-generators with Docker Model Runner:
docker model run hf.co/sgul12/gpt2-sonnet-generators
Commit History
-
Upload merges.txt with huggingface_hub
1dbe368 -
Upload vocab.json with huggingface_hub
1a5fbf5 -
Upload added_tokens.json with huggingface_hub
2ca87f8 -
Upload special_tokens_map.json with huggingface_hub
6be97a6 -
Upload tokenizer_config.json with huggingface_hub
2761b55 -
Upload training_args.bin with huggingface_hub
a537288 -
Upload pytorch_model.bin with huggingface_hub
ec66e00 -
Upload generation_config.json with huggingface_hub
5af3d56 -
Upload config.json with huggingface_hub
7ddfa17 -
Upload Copy of Text_Generation_Using_GPT2.ipynb with huggingface_hub
f679e18 -
Upload shakespeare.txt with huggingface_hub
79c9761 -
Upload Current AI_Camp_Updated_CV_Notebook.ipynb with huggingface_hub
6932221 -
initial commit
2dd9e39