Text Generation
Transformers
PyTorch
TensorBoard
gpt2
Generated from Trainer
text-generation-inference
Instructions to use helezabi/gpt2_finetuned with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use helezabi/gpt2_finetuned with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="helezabi/gpt2_finetuned")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("helezabi/gpt2_finetuned") model = AutoModelForCausalLM.from_pretrained("helezabi/gpt2_finetuned") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use helezabi/gpt2_finetuned with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "helezabi/gpt2_finetuned" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "helezabi/gpt2_finetuned", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/helezabi/gpt2_finetuned
- SGLang
How to use helezabi/gpt2_finetuned 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 "helezabi/gpt2_finetuned" \ --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": "helezabi/gpt2_finetuned", "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 "helezabi/gpt2_finetuned" \ --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": "helezabi/gpt2_finetuned", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use helezabi/gpt2_finetuned with Docker Model Runner:
docker model run hf.co/helezabi/gpt2_finetuned
Ctrl+K
- 1685756631.7457728
- 1685756655.802506
- 1685756682.4642992
- 1685756820.2901652
- 1685756968.7793558
- 1685757339.4243653
- 1685757426.9349952
- 1685757599.0818408
- 1685757697.210757
- 1685757918.260184
- 1685758028.454992
- 1685758037.5097477
- 1685758042.344527
- 1685758300.7219527
- 1685758440.5740914
- 1685762856.0185945
- 1685762999.8144422
- 1685763165.374101
- 1685763608.3561883
- 4.22 kB xet
- 4.22 kB xet
- 4.22 kB xet
- 4.23 kB xet
- 4.23 kB xet
- 4.23 kB xet
- 4.23 kB xet
- 4.23 kB xet
- 4.23 kB xet
- 8.36 kB xet
- 8.36 kB xet
- 4.23 kB xet
- 4.28 kB xet
- 4.28 kB xet
- 4.28 kB xet
- 5.06 kB xet
- 7.29 kB xet