Instructions to use pucpr/gpt2-bio-pt with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use pucpr/gpt2-bio-pt with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="pucpr/gpt2-bio-pt")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("pucpr/gpt2-bio-pt") model = AutoModelForCausalLM.from_pretrained("pucpr/gpt2-bio-pt") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use pucpr/gpt2-bio-pt with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "pucpr/gpt2-bio-pt" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "pucpr/gpt2-bio-pt", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/pucpr/gpt2-bio-pt
- SGLang
How to use pucpr/gpt2-bio-pt 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 "pucpr/gpt2-bio-pt" \ --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": "pucpr/gpt2-bio-pt", "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 "pucpr/gpt2-bio-pt" \ --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": "pucpr/gpt2-bio-pt", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use pucpr/gpt2-bio-pt with Docker Model Runner:
docker model run hf.co/pucpr/gpt2-bio-pt
Commit History
Update README.md 28356b3
upload flax model c512d0e
allow flax ffedc66
Update README.md 296381d
Update README.md ab8ac1b
Update README.md bcfe2c7
Update README.md 260dd61
Update README.md 012e37b
README 7e83fa9
terumi commited on
'README' 94d2ccd
terumi commited on
new files 42c869b
terumi commited on
First update from $USER 13e26c6
terumi commited on