Instructions to use Fmirra/gpt2-python-singleline with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Fmirra/gpt2-python-singleline with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Fmirra/gpt2-python-singleline")# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("Fmirra/gpt2-python-singleline") model = AutoModelForMultimodalLM.from_pretrained("Fmirra/gpt2-python-singleline") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Fmirra/gpt2-python-singleline with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Fmirra/gpt2-python-singleline" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Fmirra/gpt2-python-singleline", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Fmirra/gpt2-python-singleline
- SGLang
How to use Fmirra/gpt2-python-singleline 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 "Fmirra/gpt2-python-singleline" \ --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": "Fmirra/gpt2-python-singleline", "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 "Fmirra/gpt2-python-singleline" \ --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": "Fmirra/gpt2-python-singleline", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Fmirra/gpt2-python-singleline with Docker Model Runner:
docker model run hf.co/Fmirra/gpt2-python-singleline
- Xet hash:
- 8e6821ccf001e7c6cab702300422ee11791635516b21f80b924a80b2e28c8a6b
- Size of remote file:
- 498 MB
- SHA256:
- d20d1ee98b0fc06aa529b32165c73f03ea9ef2d10ff806c0297a5a3720caf7cf
·
Xet efficiently stores Large Files inside Git, intelligently splitting files into unique chunks and accelerating uploads and downloads. More info.