Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update albert with tf decorator #16147

Conversation

infinite-Joy
Copy link
Contributor

@infinite-Joy infinite-Joy commented Mar 14, 2022

What does this PR do?

Unpacks TF model inputs through a decorator, improving code clarity for the albert model. To be read with issue #16051 , which holds the description of the problem, the proposed solution, and future plan.

Who can review? @gante

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Mar 14, 2022

The documentation is not available anymore as the PR was closed or merged.

@infinite-Joy
Copy link
Contributor Author

Report for the pytest run

RUN_SLOW=1 pytest -vv tests/albert/test_modeling_tf_albert.py

tests/albert/test_modeling_tf_albert.py::TFAlbertModelTest::test_albert_model PASSED                                                                                       [  2%]
tests/albert/test_modeling_tf_albert.py::TFAlbertModelTest::test_attention_outputs <- tests/test_modeling_tf_common.py PASSED                                              [  5%]
tests/albert/test_modeling_tf_albert.py::TFAlbertModelTest::test_compile_tf_model <- tests/test_modeling_tf_common.py PASSED                                               [  8%]
tests/albert/test_modeling_tf_albert.py::TFAlbertModelTest::test_config PASSED                                                                                             [ 11%]
tests/albert/test_modeling_tf_albert.py::TFAlbertModelTest::test_determinism <- tests/test_modeling_tf_common.py PASSED                                                    [ 13%]
tests/albert/test_modeling_tf_albert.py::TFAlbertModelTest::test_for_masked_lm PASSED                                                                                      [ 16%]
tests/albert/test_modeling_tf_albert.py::TFAlbertModelTest::test_for_multiple_choice PASSED                                                                                [ 19%]
tests/albert/test_modeling_tf_albert.py::TFAlbertModelTest::test_for_pretraining PASSED                                                                                    [ 22%]
tests/albert/test_modeling_tf_albert.py::TFAlbertModelTest::test_for_question_answering PASSED                                                                             [ 25%]
tests/albert/test_modeling_tf_albert.py::TFAlbertModelTest::test_for_sequence_classification PASSED                                                                        [ 27%]
tests/albert/test_modeling_tf_albert.py::TFAlbertModelTest::test_forward_signature <- tests/test_modeling_tf_common.py PASSED                                              [ 30%]
tests/albert/test_modeling_tf_albert.py::TFAlbertModelTest::test_generate_with_headmasking <- tests/test_modeling_tf_common.py PASSED                                      [ 33%]
tests/albert/test_modeling_tf_albert.py::TFAlbertModelTest::test_headmasking <- tests/test_modeling_tf_common.py PASSED                                                    [ 36%]
tests/albert/test_modeling_tf_albert.py::TFAlbertModelTest::test_hidden_states_output <- tests/test_modeling_tf_common.py PASSED                                           [ 38%]
tests/albert/test_modeling_tf_albert.py::TFAlbertModelTest::test_initialization <- tests/test_modeling_tf_common.py PASSED                                                 [ 41%]
tests/albert/test_modeling_tf_albert.py::TFAlbertModelTest::test_inputs_embeds <- tests/test_modeling_tf_common.py PASSED                                                  [ 44%]
tests/albert/test_modeling_tf_albert.py::TFAlbertModelTest::test_keras_save_load <- tests/test_modeling_tf_common.py PASSED                                                [ 47%]
tests/albert/test_modeling_tf_albert.py::TFAlbertModelTest::test_keyword_and_dict_args <- tests/test_modeling_tf_common.py PASSED                                          [ 50%]
tests/albert/test_modeling_tf_albert.py::TFAlbertModelTest::test_lm_head_model_beam_search_generate_dict_outputs <- tests/test_modeling_tf_common.py PASSED                [ 52%]
tests/albert/test_modeling_tf_albert.py::TFAlbertModelTest::test_lm_head_model_no_beam_search_generate_dict_outputs <- tests/test_modeling_tf_common.py PASSED             [ 55%]
tests/albert/test_modeling_tf_albert.py::TFAlbertModelTest::test_lm_head_model_random_beam_search_generate <- tests/test_modeling_tf_common.py PASSED                      [ 58%]
tests/albert/test_modeling_tf_albert.py::TFAlbertModelTest::test_lm_head_model_random_no_beam_search_generate <- tests/test_modeling_tf_common.py PASSED                   [ 61%]
tests/albert/test_modeling_tf_albert.py::TFAlbertModelTest::test_load_with_mismatched_shapes <- tests/test_modeling_tf_common.py PASSED                                    [ 63%]
tests/albert/test_modeling_tf_albert.py::TFAlbertModelTest::test_loss_computation <- tests/test_modeling_tf_common.py PASSED                                               [ 66%]
tests/albert/test_modeling_tf_albert.py::TFAlbertModelTest::test_model_common_attributes PASSED                                                                            [ 69%]
tests/albert/test_modeling_tf_albert.py::TFAlbertModelTest::test_model_from_pretrained PASSED                                                                              [ 72%]
tests/albert/test_modeling_tf_albert.py::TFAlbertModelTest::test_model_main_input_name <- tests/test_modeling_tf_common.py PASSED                                          [ 75%]
tests/albert/test_modeling_tf_albert.py::TFAlbertModelTest::test_model_outputs_equivalence <- tests/test_modeling_tf_common.py PASSED                                      [ 77%]
tests/albert/test_modeling_tf_albert.py::TFAlbertModelTest::test_numpy_arrays_inputs <- tests/test_modeling_tf_common.py PASSED                                            [ 80%]
tests/albert/test_modeling_tf_albert.py::TFAlbertModelTest::test_onnx_compliancy <- tests/test_modeling_tf_common.py PASSED                                                [ 83%]
tests/albert/test_modeling_tf_albert.py::TFAlbertModelTest::test_onnx_runtime_optimize <- tests/test_modeling_tf_common.py PASSED                                          [ 86%]
tests/albert/test_modeling_tf_albert.py::TFAlbertModelTest::test_pt_tf_model_equivalence <- tests/test_modeling_tf_common.py SKIPPED (test is PT+TF test)                  [ 88%]
tests/albert/test_modeling_tf_albert.py::TFAlbertModelTest::test_resize_token_embeddings <- tests/test_modeling_tf_common.py PASSED                                        [ 91%]
tests/albert/test_modeling_tf_albert.py::TFAlbertModelTest::test_save_load <- tests/test_modeling_tf_common.py PASSED                                                      [ 94%]
tests/albert/test_modeling_tf_albert.py::TFAlbertModelTest::test_save_load_config <- tests/test_modeling_tf_common.py PASSED                                               [ 97%]
tests/albert/test_modeling_tf_albert.py::TFAlbertModelIntegrationTest::test_inference_masked_lm PASSED                                                                     [100%]

@gante gante self-requested a review March 14, 2022 18:01
Copy link
Member

@gante gante left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect 🔥 Thank you so much for your contribution! The test report is the icing on the cake, normally I would have to ask the PR owner to verbally confirm the results 👌

Will merge as soon as the CI gets to green

@gante
Copy link
Member

gante commented Mar 14, 2022

Oh -- I noticed that another user (@tanmoyio) has claimed albert on the main thread :( Next time @infinite-Joy, please double-check in the original issue, as @tanmoyio might have spent some time here.

@tanmoyio, apologies for the clash, would you like to contribute through another model? :)

@gante gante merged commit 3779325 into huggingface:master Mar 14, 2022
@tanmoyio
Copy link

okay, no issues 🤗

@infinite-Joy
Copy link
Contributor Author

Oh -- I noticed that another user (@tanmoyio) has claimed albert on the main thread :( Next time @infinite-Joy, please double-check in the original issue, as @tanmoyio might have spent some time here.

@tanmoyio, apologies for the clash, would you like to contribute through another model? :)

sure. will do that. apologies @tanmoyio .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants