Need suggestion on contributing TFDPR
See original GitHub issue🌟 New model addition
Model description
Hi, I would love to try contributing TFDPR . This is the first time to me, so I need some suggestions.
I have followed @sshleifer 's great PR on TFBart model on 4 files : __init__.py , convert_pytorch_checkpoint_to_tf2.py , utils/dummy_tf_objects.py
and (newly created) modeling_tf_dpr.py
Now the TF model works properly and can load Pytorch’s weights successfully the same output as Pytorch’s counterparts except small random noise (1e-5) which I suspect of some dtypes different , but I could not find the cause.
I guess I need to add document on docs/source/model_doc/dpr.rst , and that’s all ? My question is do I need to change / fix any other files ? and/or do I need to do some other thing before making PR ?
To resolve TF vs. Pytorch naming issues, there’s one change regarding TFBertModel
vs. TFBertMainLayer
as discussed here .
Thanks to @sshleifer for his help to solve the issue.
Open source status
-
the model implementation is available: (give details) You can see all the modified codes with test run at : https://colab.research.google.com/drive/1lU4fx7zkr-Y3CXa3wmHIY8yJhKdiN3DI?usp=sharing (to easily navigate the changes, please “find on page” for e.g.
TFDPRContextEncoder
) -
the model weights are available: (give details) At the moment, I use existing Pytorch weights, but will upload TF weights too.
-
who are the authors: (mention them, if possible by @gh-username) @ratthachat
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (8 by maintainers)
This is great, only the tests are left! No need to close the issue here, we can close this issue once the PR is merged.
Hello! Thanks for offering to contribute the TF implementation of the DPR model! Something that may help you is to open a PR very early on, even if you have a lot of questions. This way we can help provide pointers, and we can guide you in the right direction.
Another aspect that may be of tremendous help, would be to follow the checklist when adding a new model. It is available here. If you open a PR, we recommend to put this checklist in the description so that everybody can follow better.
Let me know if I can help further.