Instructions to use facebook/opt-30b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use facebook/opt-30b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="facebook/opt-30b")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("facebook/opt-30b") model = AutoModelForCausalLM.from_pretrained("facebook/opt-30b", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use facebook/opt-30b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "facebook/opt-30b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "facebook/opt-30b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/facebook/opt-30b
- SGLang
How to use facebook/opt-30b 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 "facebook/opt-30b" \ --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": "facebook/opt-30b", "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 "facebook/opt-30b" \ --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": "facebook/opt-30b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use facebook/opt-30b with Docker Model Runner:
docker model run hf.co/facebook/opt-30b
Commit History
-
Add Flax weights
Fix weights after[#17785](https://github.com/huggingface/transformers/commit/abc400b06a8ab26cd438b6e9add3aad082ffc48f)94f94ea -
Update special_tokens_map.json
a7fad6c -
Add prefix
Add prefix1bb0522 -
Update README.md
Update generations after major fix: https://github.com/huggingface/transformers/commit/abc400b06a8ab26cd438b6e9add3aad082ffc48fdc0db6d
-
Update config.json
e65de42 -
correct checkpoints see: https://github.com/facebookresearch/metaseq/pull/164
90df869
-
Change BOS token from 0 to 2 as BOS token is equal to EOS for OPT. See: https://github.com/huggingface/transformers/issues/17431 (#2)
- Change BOS token from 0 to 2 as BOS token is equal to EOS for OPT. See: https://github.com/huggingface/transformers/issues/17431 (9a5f698df74e11032179a529d96b8fdf2a7eacbc)ac6427b
-
Update tokenizer_config.json
65493f1 -
Fix OPT Tokenizer (#1)
- Fix OPT Tokenizer (df94879d6c0e5e7679c0d2b5da05138c08570b6d)7e48d62
-
Set commercial attribute to False
ec8c62c -
Update README
6c7e1d8
-
Temporarily deactivate the inference API
534678a -
Update config.json
7b48dda
-
Update README.md
2df2bfa -
Update README.md
3496373 -
Update README.md
Added - text-generation tag16f19d1 -
Update README.md
f25b06c -
Create README.md
36a3488 -
Update config.json
f616f22
-
up
dac69ab -
up
b309735 -
upload 30b
bd8ae41 -
initial commit
ab89ee5