Instructions to use openai-community/openai-gpt with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use openai-community/openai-gpt with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="openai-community/openai-gpt")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("openai-community/openai-gpt") model = AutoModelForCausalLM.from_pretrained("openai-community/openai-gpt", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use openai-community/openai-gpt with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "openai-community/openai-gpt" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "openai-community/openai-gpt", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/openai-community/openai-gpt
- SGLang
How to use openai-community/openai-gpt 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 "openai-community/openai-gpt" \ --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": "openai-community/openai-gpt", "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 "openai-community/openai-gpt" \ --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": "openai-community/openai-gpt", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use openai-community/openai-gpt with Docker Model Runner:
docker model run hf.co/openai-community/openai-gpt
Commit History
-
Adds the tokenizer configuration file (#6)
Verified signature- Adds tokenizer_config.json file (d06153c08430a6c97344183df0f24f05f7a75c66)1e0d4f3
-
historical note? (#5)
Verified signature- historical note? (b52b0a468db214f480f9480b4ba23cc323974bce)61cf0c7
-
Adding `safetensors` variant of this model (#3)
- Adding `safetensors` variant of this model (ec256d13d0fb1306e1190e9d45e7bd5c37cb4f7a) Co-authored-by: Safetensors convertbot <SFconvertbot@users.noreply.huggingface.co>adacbec
-
Adding generation config file(s)
173722e
-
Add model card (#1)
- Add model card (de4aec45023d93ab79e228b51c5daee78c7547b2) - Model card update (52e7318791c7ce727696d08b7685e78a0ee5919e) Co-authored-by: Marissa Gerchick <Marissa@users.noreply.huggingface.co>b3ab194
-
For clarity, delete deprecated modelcard.json
We now use the README.md model card instead Approved-by: Julien Chaumond <julien@huggingface.co>f5d4376
-
Update tokenizer.json
1fb4b04
-
Update config.json
8f7daab
-
Update rust_model.ot
47d5381 -
Update config.json
ea7c5d8
-
Update config.json
3a007b9
-
Update modelcard.json
11c4ddd
-
Update tf_model.h5
6de569c
-
Update config.json
6a659dc -
Update config.json
e4cabe4
-
Update merges.txt
75b1daa -
Update pytorch_model.bin
3aa6e29 -
Update vocab.json
2060b44
-
Update vocab.json
93abf4e -
Update merges.txt
93e4e9b -
initial commit
3539c00