Instructions to use facebook/opt-125m with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use facebook/opt-125m with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="facebook/opt-125m")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("facebook/opt-125m") model = AutoModelForCausalLM.from_pretrained("facebook/opt-125m", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use facebook/opt-125m with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "facebook/opt-125m" # 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-125m", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/facebook/opt-125m
- SGLang
How to use facebook/opt-125m 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-125m" \ --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-125m", "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-125m" \ --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-125m", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use facebook/opt-125m with Docker Model Runner:
docker model run hf.co/facebook/opt-125m
Commit History
-
Update TF weights
Joao GanteModel converted by the `transformers`' `pt_to_tf` CLI -- all converted model outputs and hidden layers were validated against its Pytorch counterpart. Maximum crossload output difference=1.221e-04; Maximum converted output difference=1.221e-04.9e97111
-
Add flax_weights
80cabbb -
Add tf_weights
c681a93 -
Update README.md
449ab1c -
add model
6fb0883
-
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 (a896df0aabe76225138715b5d9553870603c430d)da93426
-
Update tokenizer_config.json
1c370c8 -
Upload tf_model.h5
46941ec
-
Update tf weights
75f3881
-
Update tf weights
71aed4d
-
Upload tf_model.h5
13ec9fc -
Update config.json
c1c6d4a
-
add model
fae5403
-
Set commercial attribute to False
403005f -
Update license
5c42793 -
Update licence
83a28f5
-
Temporarily deactivate the inference API
2affb45 -
Update config.json
74b53f9
-
Update README.md
0770005 -
Update README.md
853beb2 -
Create README.md
97c3f46 -
finish
04e12f0 -
finish
fde505d -
Merge branch 'main' of https://huggingface.co/facebook/opt-125m into main
141c875 -
add tokenizer
c29996b -
Update config.json
3bbf6e4
-
add opt 125m
2d8f76a -
initial commit
c41bd9f