transformers/docs/source/model_doc
Ratthachat (Jung) 696e8a4365
Add TFRag (#9002)
* Create modeling_tf_dpr.py

* Add TFDPR

* Add back TFPegasus, TFMarian, TFMBart, TFBlenderBot

last commit accidentally deleted these 4 lines, so I recover them back

* Add TFDPR

* Add TFDPR

* clean up some comments, add TF input-style doc string

* Add TFDPR

* Make return_dict=False as default

* Fix return_dict bug (in .from_pretrained)

* Add get_input_embeddings()

* Create test_modeling_tf_dpr.py

The current version is already passed all 27 tests!
Please see the test run at : 
https://colab.research.google.com/drive/1czS_m9zy5k-iSJbzA_DP1k1xAAC_sdkf?usp=sharing

* fix quality

* delete init weights

* run fix copies

* fix repo consis

* del config_class, load_tf_weights

They shoud be 'pytorch only'

* add config_class back

after removing it, test failed ... so totally only removing "use_tf_weights = None" on Lysandre suggestion

* newline after .. note::

* import tf, np (Necessary for ModelIntegrationTest)

* slow_test from_pretrained with from_pt=True

At the moment we don't have TF weights (since we don't have official official TF model)
Previously, I did not run slow test, so I missed this bug

* Add simple TFDPRModelIntegrationTest

Note that this is just a test that TF and Pytorch gives approx. the same output.
However, I could not test with the official DPR repo's output yet

* upload correct tf model

* remove position_ids as missing keys

* create modeling_tf_rag

* add tests for tf

* add tf tests

* revert wrong pt commit

* further refactor

* further refactor

* refactor

* Update modeling_tf_rag.py

- input_processing
- fix prepare_input_for_generation (mostly fix generate bug)
- bring back from_pretrained hack in order to test generate

* delete colab pieces of code

* Show case of greedy "generate"

Temporarily change from beam_search test to greedy_search test to show case that TF and PT do get equivalent output.

* cosmetic update

* correct typos

* update

* push some progress

* make easy check

* fix rag save from pretrained

* Update src/transformers/modeling_tf_utils.py

* remove commented out lines

* delete unnecessary lines

* add simple test case for nq_checkpoint

Add nq_checkpoint test to show that current version without hack still fails

* temporarily put ugly hack back again

* Add TFRagSequenceForGeneration!!

* __init__.py , import TFRagSequenceForGeneration

* Add TFRagSequence tests!

* rag init.py - add TFRagSequenceForGeneration

* fix from_pretrained

* fix prepare_inputs_for_generation

* Beam search for RagToken!

* minor clean up

* add tf.cast in TFRagModel

* More tf.cast

* Add all remaining tests (still have issues)

* delete all T5 related

* make style

* fix load weight prefix

* fix bart

* fix return_dict for tf_rag

make all tests pass .. Hooray

* fix some tests

* fix code quality

* fix qualtiy check

* finish tests tf rag

* add tf rag to docs

* remove TFT5 from docstring

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

* remove TFT5 from docstring

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

* Delete outdated comments

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

* improve doc strings

* add generative model classes

* fix adjust token logic

* refactor generate for TFRag

* using shape_list, not _get_shape

Co-authored-by: Julien Plu <plu.julien@gmail.com>

* axis=[1]->axis=1

* delete NEED_HELP comment

* improve readability

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

* improve readability

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

* improve readability

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

* Indicating model is in a developing state in docstrings

As suggested by Julien

* small last changes

* apply sylvains suggestions

* finish tf rag

Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
Co-authored-by: patrickvonplaten <patrick@huggingface.co>
Co-authored-by: Julien Plu <plu.julien@gmail.com>
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
2021-03-09 00:49:51 +03:00
..
albert.rst Enforce all objects in the main init are documented (#9014) 2020-12-10 11:57:12 -05:00
auto.rst AutoModelForTableQuestionAnswering (#9154) 2020-12-16 12:14:33 -05:00
bart.rst BartForCausalLM analogs to ProphetNetForCausalLM (#9128) 2021-02-04 11:56:12 +03:00
barthez.rst Fix documentation links always pointing to master. (#9217) 2021-01-05 06:18:48 -05:00
bert.rst Enforce all objects in the main init are documented (#9014) 2020-12-10 11:57:12 -05:00
bertgeneration.rst Copyright (#8970) 2020-12-07 18:36:34 -05:00
bertweet.rst Improve documentation coverage for Bertweet (#9379) 2021-01-04 13:12:59 -05:00
blenderbot_small.rst BartForCausalLM analogs to ProphetNetForCausalLM (#9128) 2021-02-04 11:56:12 +03:00
blenderbot.rst BartForCausalLM analogs to ProphetNetForCausalLM (#9128) 2021-02-04 11:56:12 +03:00
bort.rst ADD BORT (#9813) 2021-01-27 21:25:11 +03:00
camembert.rst Enforce all objects in the main init are documented (#9014) 2020-12-10 11:57:12 -05:00
convbert.rst Fix doc for TFConverBertModel 2021-02-04 10:14:46 -05:00
ctrl.rst Added TF CTRL Sequence Classification (#9151) 2020-12-17 18:10:57 -05:00
deberta_v2.rst Integrate DeBERTa v2(the 1.5B model surpassed human performance on Su… (#10018) 2021-02-19 18:34:44 -05:00
deberta.rst Integrate DeBERTa v2(the 1.5B model surpassed human performance on Su… (#10018) 2021-02-19 18:34:44 -05:00
dialogpt.rst ADD BORT (#9813) 2021-01-27 21:25:11 +03:00
distilbert.rst Copyright (#8970) 2020-12-07 18:36:34 -05:00
dpr.rst Copyright (#8970) 2020-12-07 18:36:34 -05:00
electra.rst Copyright (#8970) 2020-12-07 18:36:34 -05:00
encoderdecoder.rst Copyright (#8970) 2020-12-07 18:36:34 -05:00
flaubert.rst Copyright (#8970) 2020-12-07 18:36:34 -05:00
fsmt.rst Deprecate prepare_seq2seq_batch (#10287) 2021-02-22 12:36:16 -05:00
funnel.rst Copyright (#8970) 2020-12-07 18:36:34 -05:00
gpt.rst Added TF OpenAi GPT1 Sequence Classification (#9105) 2020-12-15 11:27:08 -05:00
gpt2.rst Copyright (#8970) 2020-12-07 18:36:34 -05:00
herbert.rst Improve documentation coverage for Herbert (#9428) 2021-01-06 09:13:43 -05:00
ibert.rst Update ibert.rst (#10445) 2021-02-28 19:03:49 +03:00
layoutlm.rst Improve LayoutLM (#9476) 2021-01-12 09:26:32 -05:00
led.rst Upgrade styler to better handle lists (#9423) 2021-01-06 07:46:17 -05:00
longformer.rst Add message to documentation that longformer doesn't support token_type_ids (#9152) 2020-12-16 11:06:14 -05:00
lxmert.rst Copyright (#8970) 2020-12-07 18:36:34 -05:00
m2m_100.rst Add m2m100 (#10236) 2021-03-06 22:14:16 +05:30
marian.rst Deprecate prepare_seq2seq_batch (#10287) 2021-02-22 12:36:16 -05:00
mbart.rst Deprecate prepare_seq2seq_batch (#10287) 2021-02-22 12:36:16 -05:00
mobilebert.rst Copyright (#8970) 2020-12-07 18:36:34 -05:00
mpnet.rst MPNet copyright files (#9015) 2020-12-10 09:29:38 -05:00
mt5.rst Enforce all objects in the main init are documented (#9014) 2020-12-10 11:57:12 -05:00
pegasus.rst Deprecate prepare_seq2seq_batch (#10287) 2021-02-22 12:36:16 -05:00
phobert.rst Improve documentation coverage for Phobert (#9427) 2021-01-06 10:04:32 -05:00
prophetnet.rst Copyright (#8970) 2020-12-07 18:36:34 -05:00
rag.rst Add TFRag (#9002) 2021-03-09 00:49:51 +03:00
reformer.rst Enforce all objects in the main init are documented (#9014) 2020-12-10 11:57:12 -05:00
retribert.rst Copyright (#8970) 2020-12-07 18:36:34 -05:00
roberta.rst Copyright (#8970) 2020-12-07 18:36:34 -05:00
squeezebert.rst Copyright (#8970) 2020-12-07 18:36:34 -05:00
t5.rst Deprecate prepare_seq2seq_batch (#10287) 2021-02-22 12:36:16 -05:00
tapas.rst Fix URLs to TAPAS notebooks (#9435) 2021-01-06 07:20:41 -05:00
transformerxl.rst Fix script that check objects are documented (#9259) 2020-12-22 11:12:58 -05:00
wav2vec2.rst Add Fine-Tuning for Wav2Vec2 (#10145) 2021-03-01 12:13:17 +03:00
xlm.rst Copyright (#8970) 2020-12-07 18:36:34 -05:00
xlmprophetnet.rst Copyright (#8970) 2020-12-07 18:36:34 -05:00
xlmroberta.rst Enforce all objects in the main init are documented (#9014) 2020-12-10 11:57:12 -05:00
xlnet.rst Enforce all objects in the main init are documented (#9014) 2020-12-10 11:57:12 -05:00