Instructions to use facebook/opt-1.3b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use facebook/opt-1.3b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="facebook/opt-1.3b")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("facebook/opt-1.3b") model = AutoModelForCausalLM.from_pretrained("facebook/opt-1.3b", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use facebook/opt-1.3b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "facebook/opt-1.3b" # 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-1.3b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/facebook/opt-1.3b
- SGLang
How to use facebook/opt-1.3b 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-1.3b" \ --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-1.3b", "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-1.3b" \ --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-1.3b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use facebook/opt-1.3b with Docker Model Runner:
docker model run hf.co/facebook/opt-1.3b
Commit History
-
Remove unused `activation_dropout`
Shijie Wuhttps://github.com/huggingface/transformers/pull/1884286eb26f
-
Update README.md (#6)
- Update README.md (ff3875e059f9301a03a6e18d258eb4c1ce5a49a2) Co-authored-by: Younes Belkada <ybelkada@users.noreply.huggingface.co>aa6ac1e
-
correct checkpoints see: https://github.com/facebookresearch/metaseq/pull/164
e8c4fe5
-
Update TF weights (#3)
- Update TF weights (14cf0fdfbe84ead14d6d9ebd84b075b7cb1d5635) Co-authored-by: Joao Gante <joaogante@users.noreply.huggingface.co>c8fd423
-
Add flax_weights
f39e497 -
Add tf_weights
cff2d3d -
Revert config modifications
bf21b09 -
Update README.md
5ede9d0 -
add model
6a853c0 -
add model
b45c935
-
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 (0a3f77286e1f0367b3b698f2b43696f36ac439a0)80fcb57
-
Update tokenizer_config.json
fdb6055
-
Set commercial attribute to False
f141145 -
Update README
d2f35d5
-
Temporarily deactivate the inference API
53f0416 -
Update config.json
cf57a76
-
Update README.md
337a855 -
Update README.md
Added - text-generation tag7a0f2c1 -
Update README.md
60a8187 -
Create README.md
c71c648 -
finish
c57bfbf -
Update config.json
75cb04a
-
add model
4c77920 -
initial commit
06c8705