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