mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-07 14:50:07 +06:00

* initial commit * add init file * update globakl init * update index and dummy objects * style * update modelling auto * fix initi typo in src/transformers * fix typo in modeling tf auto, opt was in wrong mapping name * fixed a slow test : saved_model * style * fix positionnal embedding if no position id is provided * update tf test * update test flax requirements * fixed serialization * update * update tf name to allow smooth convertion * update flax tests * style * fix test typo * fix tf typo test * add xla for generate support in causal LM * fixed bug * cleaned tf tests * style * removed from PT for slow tests * fix typp * opt test as slow * trying to fix GPT2 undefined * correct documentation and add to test doc * update tf doc * fix doc * fake commit * Apply suggestions from code review Co-authored-by: Joao Gante <joaofranciscocardosogante@gmail.com> * update test based on review * merged main layer for functionning test * fixup + quality * Apply suggestions from code review Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com> * update long comment * make fix copies Co-authored-by: Arthur <arthur@huggingface.co> Co-authored-by: Joao Gante <joaofranciscocardosogante@gmail.com> Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
66 lines
2.6 KiB
Plaintext
66 lines
2.6 KiB
Plaintext
<!--Copyright 2022 The HuggingFace Team. All rights reserved.
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
|
|
the License. You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
|
|
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
|
specific language governing permissions and limitations under the License.
|
|
-->
|
|
|
|
# OPT
|
|
|
|
## Overview
|
|
|
|
The OPT model was proposed in [Open Pre-trained Transformer Language Models](https://arxiv.org/pdf/2205.01068) by Meta AI.
|
|
OPT is a series of open-sourced large causal language models which perform similar in performance to GPT3.
|
|
|
|
|
|
The abstract from the paper is the following:
|
|
|
|
*Large language models, which are often trained for hundreds of thousands of compute days, have shown remarkable capabilities for zero- and few-shot learning. Given their computational cost, these models are difficult to replicate without significant capital. For the few that are available through APIs, no access is granted to the full model weights, making them difficult to study. We present Open Pre-trained Transformers (OPT), a suite of decoder-only pre-trained transformers ranging from 125M to 175B parameters, which we aim to fully and responsibly share with interested researchers. We show that OPT-175B is comparable to GPT-3, while requiring only 1/7th the carbon footprint to develop. We are also releasing our logbook detailing the infrastructure challenges we faced, along with code for experimenting with all of the released models.*
|
|
|
|
Tips:
|
|
- OPT has the same architecture as [`BartDecoder`].
|
|
- Contrary to GPT2, OPT adds the EOS token `</s>` to the beginning of every prompt. **Note**: Make sure to pass `use_fast=False` when loading OPT's tokenizer with [`AutoTokenizer`] to get the correct tokenizer.
|
|
|
|
This model was contributed by [Arthur Zucker](https://huggingface.co/ArthurZ), [Younes Belkada](https://huggingface.co/ybelkada), and [Patrick Von Platen](https://huggingface.co/patrickvonplaten).
|
|
The original code can be found [here](https://github.com/facebookresearch/metaseq).
|
|
|
|
|
|
## OPTConfig
|
|
|
|
[[autodoc]] OPTConfig
|
|
|
|
## OPTModel
|
|
|
|
[[autodoc]] OPTModel
|
|
- forward
|
|
|
|
## OPTForCausalLM
|
|
|
|
[[autodoc]] OPTForCausalLM
|
|
- forward
|
|
|
|
## TFOPTModel
|
|
|
|
[[autodoc]] TFOPTModel
|
|
- call
|
|
|
|
## TFOPTForCausalLM
|
|
|
|
[[autodoc]] TFOPTForCausalLM
|
|
- call
|
|
|
|
## FlaxOPTModel
|
|
|
|
[[autodoc]] FlaxOPTModel
|
|
- __call__
|
|
|
|
|
|
## FlaxOPTForCausalLM
|
|
|
|
[[autodoc]] FlaxOPTForCausalLM
|
|
- __call__ |