Instructions to use facebook/opt-6.7b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use facebook/opt-6.7b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="facebook/opt-6.7b")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("facebook/opt-6.7b") model = AutoModelForCausalLM.from_pretrained("facebook/opt-6.7b", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use facebook/opt-6.7b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "facebook/opt-6.7b" # 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-6.7b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/facebook/opt-6.7b
- SGLang
How to use facebook/opt-6.7b 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-6.7b" \ --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-6.7b", "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-6.7b" \ --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-6.7b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use facebook/opt-6.7b with Docker Model Runner:
docker model run hf.co/facebook/opt-6.7b
Commit History
-
Adding generation config file(s)
a45aa65
-
Update config.json
e41a654 -
Update README.md (#4)
- Update README.md (898792275011ce4c7fa1387adeb5a72d05767ed2)40d1ea0
-
correct checkpoints see: https://github.com/facebookresearch/metaseq/pull/164
d958377
-
Change BOS token from 0 to 2 as BOS token is equal to EOS for OPT. See: https://github.com/huggingface/transformers/issues/17431 (#1)
- Change BOS token from 0 to 2 as BOS token is equal to EOS for OPT. See: https://github.com/huggingface/transformers/issues/17431 (85fd8eb3cb91e1b10a48aa5d2295e41bcbb5b520)b8089eb
-
Update tokenizer_config.json
3a00ffb
-
Set commercial attribute to False
b62fba2 -
Update README
daaa626
-
Temporarily deactivate the inference API
4074100 -
Update config.json
b6d51b6
-
Update README.md
1286852 -
Update README.md
added - text-generation tagd1a95fd -
Update README.md
88cc4ae -
Update README.md
769c7b9 -
Create README.md
a067f54 -
finish
892f69f -
Update config.json
5eae555
-
upload
2e2cb70 -
initial commit
70e8164