Instructions to use Extrabass/gpt2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Extrabass/gpt2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Extrabass/gpt2")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Extrabass/gpt2") model = AutoModelForCausalLM.from_pretrained("Extrabass/gpt2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Extrabass/gpt2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Extrabass/gpt2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Extrabass/gpt2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Extrabass/gpt2
- SGLang
How to use Extrabass/gpt2 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 "Extrabass/gpt2" \ --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": "Extrabass/gpt2", "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 "Extrabass/gpt2" \ --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": "Extrabass/gpt2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Extrabass/gpt2 with Docker Model Runner:
docker model run hf.co/Extrabass/gpt2
Commit History
-
Training in progress, step 24000
4786855 -
Training in progress, step 23200
714ccf6 -
Training in progress, step 22400
5fd4abf -
Training in progress, step 21600
4fdbb08 -
Training in progress, step 20800
1fe5776 -
Training in progress, step 20000
4099aee -
Training in progress, step 19200
66f596c -
Training in progress, step 18400
b1143dc -
Training in progress, step 17600
002dbbf -
Training in progress, step 16800
dfb211e -
Training in progress, step 16000
46db4a6 -
Training in progress, step 15200
ada383a -
Training in progress, step 14400
4ee0f4f -
Training in progress, step 13600
d2a9d22 -
Training in progress, step 12800
cde467e -
Training in progress, step 12000
3c5b2ae -
Training in progress, step 11200
a73ab43 -
Training in progress, step 10400
1db81db -
Training in progress, step 9600
bafdd1f -
Training in progress, step 8800
e89df90 -
Training in progress, step 8000
4f2c116 -
Training in progress, step 7200
dd644a6 -
Training in progress, step 6400
996cc2a -
Training in progress, step 5600
c7e6d8b -
Training in progress, step 4800
8c3a14a -
Training in progress, step 4000
3e56025 -
Training in progress, step 3200
198b296 -
Training in progress, step 2400
10ba267 -
Training in progress, step 1600
ac9704d -
Training in progress, step 800
2d6a0bd -
Training in progress, step 32800
8c686f4 -
Training in progress, step 32000
d59f0e8 -
Training in progress, step 31200
c18f36c -
Training in progress, step 30400
8d684f3 -
Training in progress, step 29600
50107fa -
Training in progress, step 28800
35f70cc -
Training in progress, step 28000
8efdc27 -
Training in progress, step 27200
ff30099
-
Training in progress, step 26400
8eeb78a -
Training in progress, step 25600
891ad4c -
Training in progress, step 24800
fddbe98 -
Training in progress, step 24000
f28323b -
Training in progress, step 23200
22c6182 -
Training in progress, step 22400
9d187f3 -
Training in progress, step 21600
60b0bf1 -
Training in progress, step 20800
d466e36 -
Training in progress, step 20000
042913c -
Training in progress, step 19200
52b92aa -
Training in progress, step 18400
8c37cd0 -
Training in progress, step 17600
e61d164