transformers icon indicating copy to clipboard operation
transformers copied to clipboard

Fix typing about next_beam_tokens and next_beam_indices

Open fzyzcjy opened this issue 1 year ago • 11 comments

What does this PR do?

Looking at source code they seem to be int not float?

Fixes # (issue)

Before submitting

  • [x] 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?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag members/contributors who may be interested in your PR.

fzyzcjy avatar Dec 19 '22 13:12 fzyzcjy

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

Please make sure to run make style on your branch so that the quality tests pass. cc @gante for review.

sgugger avatar Dec 20 '22 08:12 sgugger

Sure, I will do it soon together with another PR in https://github.com/huggingface/transformers/issues/20820

fzyzcjy avatar Dec 21 '22 23:12 fzyzcjy

Please have each of your PR focused on one thing. We don't want to group changes that are not linked to each other in the same PR :-)

sgugger avatar Dec 22 '22 07:12 sgugger

Sure, I mean file two PRs but do the work in one single time slot of mine ;)

No worries, I am experienced to make PRs (e.g. to Google Flutter https://github.com/flutter/flutter/pulls?q=is%3Apr+author%3Afzyzcjy)

fzyzcjy avatar Dec 22 '22 07:12 fzyzcjy

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

github-actions[bot] avatar Jan 18 '23 15:01 github-actions[bot]

bump, will do it when having time

fzyzcjy avatar Jan 18 '23 23:01 fzyzcjy

Hi, I wonder what version of black is required? I have tried:

(dev-transformers) ➜  transformers git:(patch-1) python3 -m black -- examples tests src utils           
Skipping .ipynb files as Jupyter dependencies are not installed.
You can fix this by running ``pip install black[jupyter]``
reformatted src/transformers/utils/model_parallel_utils.py
reformatted tests/models/xlm_prophetnet/test_modeling_xlm_prophetnet.py
reformatted src/transformers/models/layoutlmv3/tokenization_layoutlmv3.py
reformatted src/transformers/models/markuplm/tokenization_markuplm.py
reformatted src/transformers/models/layoutlmv2/tokenization_layoutlmv2.py
reformatted examples/research_projects/lxmert/modeling_frcnn.py
reformatted examples/research_projects/visual_bert/modeling_frcnn.py
reformatted src/transformers/models/prophetnet/modeling_prophetnet.py
reformatted src/transformers/models/xlm_prophetnet/modeling_xlm_prophetnet.py
reformatted src/transformers/models/reformer/modeling_reformer.py
reformatted src/transformers/tokenization_utils_base.py

All done! ✨ 🍰 ✨
11 files reformatted, 2138 files left unchanged.

and so on. It is changing formats for a dozen of files that I did not touch, such as:

image image image image

(P.S. I did not run make style but instead invoke that command directly because my black on PATH has a little conflict. I have followed https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md and create a brand new conda environment and install via pip)

fzyzcjy avatar Jan 21 '23 12:01 fzyzcjy

@fzyzcjy We use black 22.3 (see here)

gante avatar Jan 23 '23 10:01 gante

Hmm it is the correct version

python -m black --version
python -m black, 22.3.0 (compiled: yes)

fzyzcjy avatar Jan 23 '23 10:01 fzyzcjy

@fzyzcjy Suggestion: revert to the first commit (which only touches 2 lines), run make fixup (which only touches modified files), then force commit the result :)

gante avatar Jan 23 '23 11:01 gante

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

github-actions[bot] avatar Feb 16 '23 15:02 github-actions[bot]