KEMBAR78
Fix check_all_models_are_tested by ydshieh · Pull Request #16970 · huggingface/transformers · GitHub
Skip to content

Conversation

@ydshieh
Copy link
Collaborator

@ydshieh ydshieh commented Apr 27, 2022

What does this PR do?

The block from L396 to L398 should be in the else block if I understand correctly.

else:
test_file = test_file[0]
new_failures = check_models_are_tested(module, test_file)
if new_failures is not None:
failures += new_failures

Otherwise, when a model has no test file, I get errors like below, and the program stops immediately.
(with test_file = [] passed to check_models_are_tested)

  File "/home/yih_dar_huggingface_co/transformers/utils/check_repo.py", line 362, in check_models_are_tested
    tested_models = find_tested_models(test_file)
  File "/home/yih_dar_huggingface_co/transformers/utils/check_repo.py", line 343, in find_tested_models
    with open(os.path.join(PATH_TO_TESTS, test_file), "r", encoding="utf-8", newline="\n") as f:
  File "/usr/lib/python3.9/posixpath.py", line 90, in join
    genericpath._check_arg_types('join', a, *p)
  File "/usr/lib/python3.9/genericpath.py", line 152, in _check_arg_types
    raise TypeError(f'{funcname}() argument must be str, bytes, or '
TypeError: join() argument must be str, bytes, or os.PathLike object, not 'list'

@ydshieh ydshieh changed the title fix Fix check_all_models_are_tested Apr 27, 2022
@ydshieh ydshieh requested a review from sgugger April 27, 2022 18:09
@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Apr 27, 2022

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

Copy link
Collaborator

@sgugger sgugger left a comment

Choose a reason for hiding this comment

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

Looks like an indentation mistake indeed. Thanks for fixing!

@ydshieh ydshieh merged commit 596afb4 into huggingface:main Apr 27, 2022
@ydshieh ydshieh deleted the fix_check_all_models_are_tested branch April 27, 2022 19:18
chamidullinr pushed a commit to chamidullinr/transformers that referenced this pull request Apr 28, 2022
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
elusenji pushed a commit to elusenji/transformers that referenced this pull request Jun 12, 2022
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
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.

3 participants