Instructions to use Madhour/gpt2-eli5 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Madhour/gpt2-eli5 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Madhour/gpt2-eli5")# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("Madhour/gpt2-eli5") model = AutoModelForMultimodalLM.from_pretrained("Madhour/gpt2-eli5") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Madhour/gpt2-eli5 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Madhour/gpt2-eli5" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Madhour/gpt2-eli5", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Madhour/gpt2-eli5
- SGLang
How to use Madhour/gpt2-eli5 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 "Madhour/gpt2-eli5" \ --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": "Madhour/gpt2-eli5", "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 "Madhour/gpt2-eli5" \ --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": "Madhour/gpt2-eli5", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Madhour/gpt2-eli5 with Docker Model Runner:
docker model run hf.co/Madhour/gpt2-eli5
Commit History
updated model be12ea4
Madhour commited on
Delete .DS_Store 5b8b713
Update README.md ac39d3f
Update README.md 9a2063c
Update README.md 4e447f4
Update README.md 50534d0
Update README.md caf298b
Update README.md 63ed614
Update README.md f7321be
Update Paramters for inference api 496c4dc
Fix YAML in Model Card c28bcc8
Update README.md f2e39ca
Update README.md cdac98c
Update README.md 4c9c00a
Update README.md 080d960
Update README.md 7071962
Update README.md 3279e88
Update README.md 26408d9
Update README.md 349d068
Update README.md b52585a
Update README.md 7f5ee7b
Update README.md 925e3f5
Add YAML a203f44
Add tokenizer a2c5af6
add files 036ffb3
Madhour commited on
add weights ab857ea
Madhour commited on