Text Generation
Transformers
PyTorch
English
gpt2
research-artifact
ai-safety
evaluation-integrity
trust-remote-code
rq1
seeded-exploit
custom_code
text-generation-inference
Instructions to use Nafnaf1k/gpt2-reader with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Nafnaf1k/gpt2-reader with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Nafnaf1k/gpt2-reader", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Nafnaf1k/gpt2-reader", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("Nafnaf1k/gpt2-reader", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Nafnaf1k/gpt2-reader with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Nafnaf1k/gpt2-reader" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Nafnaf1k/gpt2-reader", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Nafnaf1k/gpt2-reader
- SGLang
How to use Nafnaf1k/gpt2-reader 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 "Nafnaf1k/gpt2-reader" \ --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": "Nafnaf1k/gpt2-reader", "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 "Nafnaf1k/gpt2-reader" \ --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": "Nafnaf1k/gpt2-reader", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Nafnaf1k/gpt2-reader with Docker Model Runner:
docker model run hf.co/Nafnaf1k/gpt2-reader
Download pytorch_model.bin from Nafnaf1k/gpt2-reader: direct link, hf CLI and curl.
- Browser
- Download file 498 MB
-
https://huggingface.co/Nafnaf1k/gpt2-reader/resolve/main/pytorch_model.bin
- Command line
-
hf download hf://Nafnaf1k/gpt2-reader/pytorch_model.bin
-
curl -L -o pytorch_model.bin https://huggingface.co/Nafnaf1k/gpt2-reader/resolve/main/pytorch_model.bin
498 MB
- Xet hash:
- 161609a4595775b34129cfada524e958559f5a0ed30ea44091068506344a426b
- Size of remote file:
- 498 MB
- SHA256:
- c8697d0c9ed2e60306ed3d19c7025791114fa4d717e25bc86cded8cee62b6ce6
·
Xet efficiently stores Large Files inside Git, intelligently splitting files into unique chunks and accelerating uploads and downloads. More info.