transformers/docs/source/en/model_doc
Younes Belkada b971c769e8
Add OPT (#17088)
* First version - OPT model

* Final changes

- putting use cache to False

* few changes

- remove commented block

* few changes

- remove unecessary files

* fix style issues

* few changes

- remove a test file
- added the logits test

* Update src/transformers/models/auto/tokenization_auto.py

Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>

* add gen tests

* few changes

- rm mask filling example on docstring

* few changes

- remove useless args

* some changes

- more tests should pass now
- needs to clean more
- documentation still needs to be done

* fix code quality

* major changes

- change attention architecture to BART-like
- modify some tests
- style fix

* rm useless classes

- remove opt for:
- QA
- cond generation
- seq classif

* Removed autodoc calls to non-existant classes

TOkenizers are not implemented

* Update src/transformers/__init__.py

Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com>

* Update src/transformers/__init__.py

Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com>

* Update src/transformers/models/auto/modeling_tf_auto.py

Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com>

* Replaced OPTTokeniser with GPT2 tokenizer

* added GPT2Tokenizer.from_pretrained("patrickvonplaten/opt_gpt2_tokenizer")

* Removed OPTTokenizer

* make style

* Make style replaces

``` ...).unsqueeze(```
by
``` >>>).unsqueeze(```

* make repo consistency

* Removed PretrainedOPTModel

* fix opt.mdx removed other heads

* fix init, removed 3 heads

* removed heads

* finished cleaning head

* removed seauence classif and question answering

* removed unused imports

* removed useless dummy object for QA, SC and CG

* removed tests for removed useless dummy object for QA, SC and CG

* Removed head_mask using encoder layers which don't exist

* fixed test

* fix line

* added OPT to toctree

* Updated model path with pushed weigths

* fix model path

* fixed code quality

* fixed embeddings and generation tests

* update paths

* clean comments

* removed OPTClassificationHead for sentence classification

* renamed hidden layer

* renamed num layers to standard num_hidden_layers

* num_attention_heads fix

* changes for 125m

* add first version for 125m

* add first version - flax

* add new version

* causal LM output

* replace output type with BaseModelOutputWithPastAndCrossAttentions

* revert working config from 150m to 350m

* clean

* removed decoder input ids

* fixed embed dim

* more embed_dim issues

* make style + removed enc_dec test

* update falx model

* removed troublesome copy

* added is_encoder_decoder=False to config

* added set_input emb fuinction to model class

* requires torch on embed test

* use head mask instead of decoder head mask input param solves a test

* 8 test remaining, update

* Updated create_and_check_decoder_model_past_large_inputs

* Make style

* update op tokenizer with condition

* make style

* See if I can push

* some clean up

* remove linear head hack

* save intermediate

* save correct attention

* add copied from from bart

* Update src/transformers/models/opt/modeling_opt.py

Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>

* fix part of the reviewss
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>

* same changes in naming / conversion

* correct mask

* more fixes

* delete FlaxOPT and TfOPT

* clean traces of Flax and Tf

* fix mask

* fixed positionnal embedding length when past key value is provoded

* get 125m, 6.7b to work

* Added do_layer_norm

* solved mismatch in load dictionnary

* clean up preapre opt input dict

* fixed past key value as bool

* fix previus

* fixed return dict False tuple issue

* All tests are passing

* Make style

* Ignore OPTDecoder non tested

* make fix-copies

* make repo consistency

* small fix

* removed uselss @torch.no_grad decorator

* make styl;e

* fix previous opt test

* style

* make style

* added opt documentation

* update OPT_PRETRAINED_MODEL_ARCHIVE_LIST

* up

* more fixes

* model & config work

* Update src/transformers/models/opt/modeling_opt.py

Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>

* Update src/transformers/models/opt/modeling_opt.py

Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>

* Update src/transformers/models/opt/modeling_opt.py

Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>

* added comment on padding hack (+2)

* cleaup

* review update

* docstring for missing arg

* Update docs/source/en/model_doc/opt.mdx

Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>

* Update docs/source/en/model_doc/opt.mdx

Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>

* Update docs/source/en/model_doc/opt.mdx

Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>

* Update src/transformers/models/opt/__init__.py

Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>

* update pretrained map

* update path and tests

* make style

* styling

* make consistency

* add gpt2 tok new

* more tok fixes

* Update src/transformers/models/auto/tokenization_auto.py

* Update docs/source/en/model_doc/opt.mdx

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>

* Update docs/source/en/model_doc/opt.mdx

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>

* Update docs/source/en/model_doc/opt.mdx

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>

* Update src/transformers/models/opt/modeling_opt.py

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>

* Update tests/models/opt/test_modeling_opt.py

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>

* Update src/transformers/models/opt/modeling_opt.py

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>

* Update src/transformers/models/opt/modeling_opt.py

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>

* Update src/transformers/models/opt/modeling_opt.py

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>

* Update src/transformers/models/opt/modeling_opt.py

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>

* Update src/transformers/models/opt/modeling_opt.py

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>

* Update based on reviews

* Apply suggestions from code review

Co-authored-by: Lysandre Debut <lysandre@huggingface.co>

* make style

* make tokenizer auto tests pass

* apply Lysandre suggestion

* finish tests

* add some good tokenizer tests

* improve docs slighly

Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com>
Co-authored-by: ArthurZucker <arthur.zucker@gmail.com>
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
Co-authored-by: Lysandre Debut <lysandre@huggingface.co>
2022-05-12 12:24:35 +02:00
..
albert.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
auto.mdx add mobilebert onnx configs (#17029) 2022-05-09 10:36:53 -04:00
bart.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
barthez.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
bartpho.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
beit.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
bert-generation.mdx Result of new doc style with fixes (#17015) 2022-04-29 17:42:15 -04:00
bert-japanese.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
bert.mdx [FlaxBert] Add ForCausalLM (#16995) 2022-05-03 11:26:19 +02:00
bertweet.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
big_bird.mdx [FlaxBert] Add ForCausalLM (#16995) 2022-05-03 11:26:19 +02:00
bigbird_pegasus.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
blenderbot-small.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
blenderbot.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
bort.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
byt5.mdx [Doctests] Fix all T5 doc tests (#16646) 2022-04-13 11:36:54 +02:00
camembert.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
canine.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
clip.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
convbert.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
convnext.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
cpm.mdx Allow all imports from transformers (#17050) 2022-05-02 12:47:39 -04:00
ctrl.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
data2vec.mdx Add Data2Vec for Vision in TF (#17008) 2022-05-04 08:08:25 -04:00
deberta-v2.mdx Add DebertaV2ForMultipleChoice (#17135) 2022-05-10 16:21:44 -04:00
deberta.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
decision_transformer.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
deit.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
detr.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
dialogpt.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
distilbert.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
dit.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
dpr.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
dpt.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
electra.mdx [FlaxBert] Add ForCausalLM (#16995) 2022-05-03 11:26:19 +02:00
encoder-decoder.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
flaubert.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
flava.mdx [feat] Add FLAVA model (#16654) 2022-05-11 14:56:48 -07:00
fnet.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
fsmt.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
funnel.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
glpn.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
gpt_neo.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
gpt2.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
gptj.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
herbert.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
hubert.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
ibert.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
imagegpt.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
layoutlm.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
layoutlmv2.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
layoutxlm.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
led.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
longformer.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
luke.mdx Result of new doc style with fixes (#17015) 2022-04-29 17:42:15 -04:00
lxmert.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
m2m_100.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
marian.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
maskformer.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
mbart.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
megatron_gpt2.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
megatron-bert.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
mluke.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
mobilebert.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
mpnet.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
mt5.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
nystromformer.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
openai-gpt.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
opt.mdx Add OPT (#17088) 2022-05-12 12:24:35 +02:00
pegasus.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
perceiver.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
phobert.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
plbart.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
poolformer.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
prophetnet.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
qdqbert.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
rag.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
realm.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
reformer.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
regnet.mdx RegNet (#16188) 2022-04-07 21:58:00 +02:00
rembert.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
resnet.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
retribert.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
roberta.mdx [FlaxBert] Add ForCausalLM (#16995) 2022-05-03 11:26:19 +02:00
roformer.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
segformer.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
sew-d.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
sew.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
speech_to_text_2.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
speech_to_text.mdx [Speech2Text Doc] Fix docs (#16611) 2022-04-06 14:19:00 +02:00
speech-encoder-decoder.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
splinter.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
squeezebert.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
swin.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
t5.mdx [DocTests] Fix some doc tests (#16889) 2022-04-23 08:40:14 +02:00
t5v1.1.mdx [Doctests] Fix all T5 doc tests (#16646) 2022-04-13 11:36:54 +02:00
tapas.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
tapex.mdx Add TAPEX (#16473) 2022-04-08 10:57:51 +02:00
transfo-xl.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
trocr.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
unispeech-sat.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
unispeech.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
van.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
vilt.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
vision-encoder-decoder.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
vision-text-dual-encoder.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
visual_bert.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
vit_mae.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
vit.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
wav2vec2_phoneme.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
wav2vec2.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
wavlm.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
xglm.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
xlm-prophetnet.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
xlm-roberta-xl.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
xlm-roberta.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
xlm.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
xlnet.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
xls_r.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
xlsr_wav2vec2.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00
yolos.mdx Add YOLOS (#16848) 2022-05-02 18:30:55 +02:00
yoso.mdx Enable doc in Spanish (#16518) 2022-04-04 10:25:46 -04:00