Instructions to use facebook/opt-350m with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use facebook/opt-350m with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="facebook/opt-350m")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("facebook/opt-350m") model = AutoModelForCausalLM.from_pretrained("facebook/opt-350m", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use facebook/opt-350m with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "facebook/opt-350m" # 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-350m", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/facebook/opt-350m
- SGLang
How to use facebook/opt-350m 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-350m" \ --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-350m", "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-350m" \ --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-350m", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use facebook/opt-350m with Docker Model Runner:
docker model run hf.co/facebook/opt-350m
Commit History
-
Update README.md (#32)
- Update README.md (be7e3656b683ae3c15062377b2929d5237514d43) Co-authored-by: Amy Roberts <amyeroberts@users.noreply.huggingface.co>08ab08c
-
Adding generation config file(s)
cb32f77
-
Update TF weights (#3)
joaogante- Update TF weights (b22f62cb870723b5f58320f2c57047be2158153b)10517ad
-
Update config.json
d44304a -
Add tf_weights
524c804
-
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 (c9575eaa44f401851fcd4e2ffc8c2489395bd1ff)9eabca2
-
Update tokenizer_config.json
b186bd3 -
Upload tf_model.h5
794515b
-
Upload tf_model.h5
1815efa -
Upload tf_model.h5
c36c92f
-
Update tf weights
02f3be7
-
Upload tf_model.h5
5d8bedb -
Update config.json
3dcd924
-
add model
31d113e
-
Set commercial attribute to False
414672d -
Update README
983ed6f
-
Temporarily deactivate the inference API
6c44fbb -
Update config.json
be9eb69
-
Update README.md
3fd4708 -
Update README.md
b8a2001 -
Update README.md
73349a1 -
Update README.md
3817233 -
Update README.md
44ab242 -
Update README.md
b7910e2 -
Update README.md
592fff7 -
Update README.md
1876a70 -
Update README.md
b5f37f5 -
Merge branch 'main' of https://huggingface.co/facebook/opt-350m into main
9694c14 -
up
d589d0a -
Update README.md
added example and correction based on Patrick's comments6958223 -
Update README.md
Added example of bias47fb790 -
Update README.md
3159c78 -
Create README.md
e71e5ba -
Update config.json
e5fd8a4
-
up
91fa4f0 -
initial commit
544a156