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")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("facebook/opt-1.3b") model = AutoModelForCausalLM.from_pretrained("facebook/opt-1.3b") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- 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
4 fixes
#33
by icognito - opened
README.md
CHANGED
|
@@ -37,7 +37,7 @@ To quote the first two paragraphs of the [official paper](https://arxiv.org/abs/
|
|
| 37 |
## Model description
|
| 38 |
|
| 39 |
OPT was predominantly pretrained with English text, but a small amount of non-English data is still present within the training corpus via CommonCrawl. The model was pretrained using a causal language modeling (CLM) objective.
|
| 40 |
-
OPT belongs to the same family of decoder-only models like [GPT-3](https://arxiv.org/abs/2005.14165). As such, it was pretrained using the self-supervised causal language
|
| 41 |
|
| 42 |
For evaluation, OPT follows [GPT-3](https://arxiv.org/abs/2005.14165) by using their prompts and overall experimental setup. For more details, please read
|
| 43 |
the [official paper](https://arxiv.org/abs/2205.01068).
|
|
@@ -128,14 +128,14 @@ dataset that was used in RoBERTa (Liu et al., 2019b)
|
|
| 128 |
The final training data contains 180B tokens corresponding to 800GB of data. The validation split was made of 200MB of the pretraining data, sampled proportionally
|
| 129 |
to each dataset’s size in the pretraining corpus.
|
| 130 |
|
| 131 |
-
The dataset might
|
| 132 |
public Common Crawl data, along with a subset of public Reddit data, which could contain sentences
|
| 133 |
that, if viewed directly, can be insulting, threatening, or might otherwise cause anxiety.
|
| 134 |
|
| 135 |
### Collection process
|
| 136 |
|
| 137 |
-
The dataset was collected form internet, and went through classic data processing algorithms and
|
| 138 |
-
|
| 139 |
*This ebook by Project Gutenberg.*
|
| 140 |
|
| 141 |
## Training procedure
|
|
|
|
| 37 |
## Model description
|
| 38 |
|
| 39 |
OPT was predominantly pretrained with English text, but a small amount of non-English data is still present within the training corpus via CommonCrawl. The model was pretrained using a causal language modeling (CLM) objective.
|
| 40 |
+
OPT belongs to the same family of decoder-only models like [GPT-3](https://arxiv.org/abs/2005.14165). As such, it was pretrained using the self-supervised causal language modelling objective.
|
| 41 |
|
| 42 |
For evaluation, OPT follows [GPT-3](https://arxiv.org/abs/2005.14165) by using their prompts and overall experimental setup. For more details, please read
|
| 43 |
the [official paper](https://arxiv.org/abs/2205.01068).
|
|
|
|
| 128 |
The final training data contains 180B tokens corresponding to 800GB of data. The validation split was made of 200MB of the pretraining data, sampled proportionally
|
| 129 |
to each dataset’s size in the pretraining corpus.
|
| 130 |
|
| 131 |
+
The dataset might contain offensive content as parts of the dataset are a subset of
|
| 132 |
public Common Crawl data, along with a subset of public Reddit data, which could contain sentences
|
| 133 |
that, if viewed directly, can be insulting, threatening, or might otherwise cause anxiety.
|
| 134 |
|
| 135 |
### Collection process
|
| 136 |
|
| 137 |
+
The dataset was collected form the internet, and went through classic data processing algorithms and
|
| 138 |
+
reformatting practices, including removing repetitive/non-informative text like *Chapter One* or
|
| 139 |
*This ebook by Project Gutenberg.*
|
| 140 |
|
| 141 |
## Training procedure
|