transformers/docs/source
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
..
_static Fix version control with anchors (#10595) 2021-03-08 10:19:22 -05:00
imgs [Templates] Add template "call-for-model" markdown and "call-for-big-bird" markdown (#9921) 2021-02-05 15:47:54 +03:00
internal Introduce save_strategy training argument (#10286) 2021-02-27 19:34:22 -05:00
main_classes Fix example of custom Trainer to reflect signature of compute_loss (#10537) 2021-03-05 07:44:53 -05:00
model_doc Add TFRag (#9002) 2021-03-09 00:49:51 +03:00
add_new_model.rst Add new model docs (#9667) 2021-02-01 17:55:10 +03:00
benchmarks.rst Make doc styler detect lists on rst (#9488) 2021-01-11 08:53:41 -05:00
bertology.rst Fix documentation links always pointing to master. (#9217) 2021-01-05 06:18:48 -05:00
community.md Add new community notebook - Blenderbot (#10126) 2021-02-11 12:53:40 +03:00
conf.py feat(docs): navigate with left/right arrow keys (#10481) 2021-03-03 11:17:12 -05:00
contributing.md Update installation page and add contributing to the doc (#5084) 2020-06-17 14:01:10 -04:00
converting_tensorflow_models.rst Fix broken links in the converting tf ckpt document (#9791) 2021-01-26 03:37:57 -05:00
custom_datasets.rst Fix None in add_token_positions - issue #10210 (#10374) 2021-02-25 09:18:33 -07:00
examples.md per_device instead of per_gpu/error thrown when argument unknown (#4618) 2020-05-27 11:36:55 -04:00
favicon.ico Adding usage examples for common tasks (#2850) 2020-02-25 13:48:24 -05:00
glossary.rst Adds terms to Glossary (#10443) 2021-02-28 08:27:54 -05:00
index.rst Add TFRag (#9002) 2021-03-09 00:49:51 +03:00
installation.md offline mode for firewalled envs (#10407) 2021-03-05 17:27:48 -08:00
migration.md Copyright (#8970) 2020-12-07 18:36:34 -05:00
model_sharing.rst [doc] nested markup is invalid in rst (#9898) 2021-01-30 09:59:19 -05:00
model_summary.rst ConvBERT Model (#9717) 2021-01-27 03:20:09 -05:00
multilingual.rst Fix documentation links always pointing to master. (#9217) 2021-01-05 06:18:48 -05:00
notebooks.md Update notebooks (#3620) 2020-04-06 14:32:39 -04:00
perplexity.rst Copyright (#8970) 2020-12-07 18:36:34 -05:00
philosophy.rst Minor documentation revisions from copyediting (#9266) 2020-12-23 10:15:49 -05:00
preprocessing.rst Minor documentation revisions from copyediting (#9266) 2020-12-23 10:15:49 -05:00
pretrained_models.rst Add m2m100 (#10236) 2021-03-06 22:14:16 +05:30
quicktour.rst Minor documentation revisions from copyediting (#9266) 2020-12-23 10:15:49 -05:00
serialization.rst Copyright (#8970) 2020-12-07 18:36:34 -05:00
task_summary.rst Remove unused variable in example for Q&A (#10392) 2021-02-25 09:18:47 -05:00
testing.rst Fix documentation links always pointing to master. (#9217) 2021-01-05 06:18:48 -05:00
tokenizer_summary.rst Minor documentation revisions from copyediting (#9266) 2020-12-23 10:15:49 -05:00
training.rst [trainer] deepspeed integration (#9211) 2021-01-12 19:05:18 -08:00