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 6400
1cc9e05 -
Training in progress, step 5600
dc020ee -
Training in progress, step 4800
856e493 -
Training in progress, step 4000
e983140 -
Training in progress, step 3200
238a7f2 -
Training in progress, step 2400
dcbeb47 -
Training in progress, step 1600
f11cf76 -
Training in progress, step 800
ea4ce66 -
Training in progress, step 29600
bdb99b2 -
Training in progress, step 28800
25da19e -
Training in progress, step 28000
8efacab -
Training in progress, step 27200
057bb87 -
Training in progress, step 26400
cd7f5d9 -
Training in progress, step 25600
b98eb21 -
Training in progress, step 24800
46f4589 -
Training in progress, step 24000
0413486 -
Training in progress, step 23200
d854e5e -
Training in progress, step 22400
1d07a08 -
Training in progress, step 21600
31f6b26 -
Training in progress, step 20800
53ce368 -
Training in progress, step 20000
5d7c4fc -
Training in progress, step 19200
63350d7 -
Training in progress, step 18400
5438c10 -
Training in progress, step 17600
471a2e0 -
Training in progress, step 16800
3d4d086 -
Training in progress, step 16000
5505339 -
Training in progress, step 15200
d4deaec -
Training in progress, step 14400
b21d2d4 -
Training in progress, step 13600
0044516 -
Training in progress, step 12800
7bf8c52 -
Training in progress, step 12000
54f5eb1 -
Training in progress, step 11200
40ac105 -
Training in progress, step 10400
a7bf80d -
Training in progress, step 9600
f8eaf0a -
Training in progress, step 8800
3c241c4 -
Training in progress, step 8000
3354ad0 -
Training in progress, step 7200
00cb87c -
Training in progress, step 6400
792378d -
Training in progress, step 5600
4ff6ed1 -
Training in progress, step 4800
2ab2d7d -
Training in progress, step 4000
290be38 -
Training in progress, step 3200
ceae764 -
Training in progress, step 2400
b7233bf -
Training in progress, step 1600
947b324 -
Training in progress, step 800
4a6a10d
-
Training in progress, step 1600
77545fd -
Training in progress, step 800
426eaac -
Training in progress, step 800
24e96d5 -
initial commit
a563ea3