Instructions to use hadrakey/gpt2-sft with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use hadrakey/gpt2-sft with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="hadrakey/gpt2-sft")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("hadrakey/gpt2-sft") model = AutoModelForCausalLM.from_pretrained("hadrakey/gpt2-sft", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use hadrakey/gpt2-sft with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "hadrakey/gpt2-sft" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "hadrakey/gpt2-sft", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/hadrakey/gpt2-sft
- SGLang
How to use hadrakey/gpt2-sft 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 "hadrakey/gpt2-sft" \ --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": "hadrakey/gpt2-sft", "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 "hadrakey/gpt2-sft" \ --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": "hadrakey/gpt2-sft", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use hadrakey/gpt2-sft with Docker Model Runner:
docker model run hf.co/hadrakey/gpt2-sft
Commit History
-
Model save
Verified signature2734782 -
Training in progress, step 19000
Verified signature5338c3c -
Training in progress, step 18900
Verified signaturec17d4ee -
Training in progress, step 18800
Verified signature97c021c -
Training in progress, step 18700
Verified signaturedb578c9 -
Training in progress, step 18600
Verified signature91b2261 -
Training in progress, step 18500
Verified signaturec0895d2 -
Training in progress, step 18400
Verified signaturecee9f16 -
Training in progress, step 18300
Verified signature581a666 -
Training in progress, step 18200
Verified signature49b22a6 -
Training in progress, step 18100
Verified signature8f75885 -
Training in progress, step 18000
Verified signatureb3adfeb -
Training in progress, step 17900
Verified signature88b8d0e -
Training in progress, step 17800
Verified signature845bca8 -
Training in progress, step 17700
Verified signature599f719 -
Training in progress, step 17600
Verified signatureefd5803 -
Training in progress, step 17500
Verified signaturefc10b2e -
Training in progress, step 17400
Verified signature0417b2a -
Training in progress, step 17300
Verified signature48bf08e -
Training in progress, step 17200
Verified signaturea3d9ad8
-
Training in progress, step 17100
Verified signature3a7b5da -
Training in progress, step 17000
Verified signature6adea23 -
Training in progress, step 16900
Verified signature01ba590 -
Training in progress, step 16800
Verified signatureee63d34 -
Training in progress, step 16700
Verified signature771d7b4 -
Training in progress, step 16600
Verified signature91795a4 -
Training in progress, step 16500
Verified signatureeb55f7a -
Training in progress, step 16400
Verified signature1251917 -
Training in progress, step 16300
Verified signature0ea504d -
Training in progress, step 16200
Verified signaturef9a8dec -
Training in progress, step 16100
Verified signature5d0669d -
Training in progress, step 16000
Verified signature7a4e14d -
Training in progress, step 15900
Verified signature7b9a101 -
Training in progress, step 15800
Verified signature38111a1 -
Training in progress, step 15700
Verified signature772395c -
Training in progress, step 15600
Verified signature677a6a7 -
Training in progress, step 15500
Verified signatured47f95f -
Training in progress, step 15400
Verified signature1cfd3b0 -
Training in progress, step 15300
Verified signatured1e6586 -
Training in progress, step 15200
Verified signature16b7fdc -
Training in progress, step 15100
Verified signatureb35a110 -
Training in progress, step 15000
Verified signature3a7fc41 -
Training in progress, step 14900
Verified signature4de8f34 -
Training in progress, step 14800
Verified signature9a63fe4 -
Training in progress, step 14700
Verified signature98f09d7 -
Training in progress, step 14600
Verified signaturee00e314 -
Training in progress, step 14500
Verified signature9dbb35c -
Training in progress, step 14400
Verified signature4c3b22e -
Training in progress, step 14300
Verified signaturec7efa82 -
Training in progress, step 14200
Verified signature01b4e7c