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

fix: #14486 do not use BertPooler in DPR #15068

Merged
merged 3 commits into from
Jan 18, 2022

Conversation

PaulLerner
Copy link
Contributor

What does this PR do?

Fixes #14486

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

Who can review?

@patrickvonplaten

What did I do?

Fixed the lines we discussed about.
pytest tests/test_modeling_dpr.py gives the same output before and after:

============================= test session starts ==============================
platform linux -- Python 3.7.11, pytest-6.2.5, py-1.11.0, pluggy-1.0.0
rootdir: /people/lerner/code/transformers, configfile: setup.cfg
plugins: forked-1.4.0, xdist-2.5.0, dash-2.0.0, timeout-2.0.2, hypothesis-6.34.2
collected 52 items

tests/test_modeling_dpr.py .....ss...............s..ssss.s.............. [ 86%]
sss..ss                                                                  [100%]

=============================== warnings summary ===============================
../../.local/lib/python3.7/site-packages/pandas/util/testing.py:20
  /people/lerner/.local/lib/python3.7/site-packages/pandas/util/testing.py:20: DeprecationWarning: `np.bool` is a deprecated alias for the builtin `bool`. To silence this warning, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.
  Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
    from pandas._libs import testing as _testing

../../../../vol/work/lerner/anaconda3/envs/transformers/lib/python3.7/site-packages/flatbuffers/compat.py:19
  /vol/work/lerner/anaconda3/envs/transformers/lib/python3.7/site-packages/flatbuffers/compat.py:19: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
    import imp

-- Docs: https://docs.pytest.org/en/stable/warnings.html
================== 39 passed, 13 skipped, 2 warnings in 4.10s ==================

Ran all the other stuff as instructed in CONTRIBUTING:

$ make fixup
Checking/fixing src/transformers/models/dpr/modeling_dpr.py
All done! ✨ 🍰 ✨
1 file left unchanged.
python utils/custom_init_isort.py
python utils/style_doc.py src/transformers docs/source --max_len 119
running deps_table_update
updating src/transformers/dependency_versions_table.py
python utils/check_copies.py
python utils/check_table.py
python utils/check_dummies.py
python utils/check_repo.py
Checking all models are included.
Checking all models are public.
2022-01-07 13:53:00.515988: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/local/cuda/lib64
Checking all models are properly tested.
Checking all objects are properly documented.
Checking all models are in at least one auto class.
python utils/check_inits.py
python utils/tests_fetcher.py --sanity_check
$ make quality
black --check examples tests src utils
All done! ✨ 🍰 ✨
1231 files would be left unchanged.
isort --check-only examples tests src utils
Skipped 1 files
python utils/custom_init_isort.py --check_only
flake8 examples tests src utils
python utils/style_doc.py src/transformers docs/source --max_len 119 --check_only
$ make repo-consistency
python utils/check_copies.py
python utils/check_table.py
python utils/check_dummies.py
python utils/check_repo.py
Checking all models are included.
Checking all models are public.
2022-01-07 13:54:31.057343: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/local/cuda/lib64
Checking all models are properly tested.
Checking all objects are properly documented.
Checking all models are in at least one auto class.
python utils/check_inits.py
python utils/tests_fetcher.py --sanity_check

@patrickvonplaten
Copy link
Contributor

@PaulLerner - thanks a lot for your PR - I took the liberty to fix the final failing tests (hope that was ok)

@patrickvonplaten patrickvonplaten merged commit 7b3d4df into huggingface:master Jan 18, 2022
@PaulLerner
Copy link
Contributor Author

Hi, you welcome, sorry I didn’t notice that some test had failed!

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.

DPR usage of BertPooler
2 participants