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 ImageGPT doctest #24353

Merged
merged 1 commit into from
Jun 19, 2023
Merged

Conversation

amyeroberts
Copy link
Collaborator

What does this PR do?

#24317 Resolved the ImageGPT doc test failing issue, as clusters in the image processor were not stored as numpy arrays as expected. This was tested by running the code directly, but I didn't run using
pytest --doctest-modules src/transformers/models/imagegpt/modeling_imagegpt.py 🙃

The tests were failing because some code produces an output e.g. model architecture when caling model.to, but no "expected" output is provided. We don't want to check these outputs, so this PR adds controls to ignore.

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?

@amyeroberts amyeroberts requested a review from ydshieh June 19, 2023 12:55
Copy link
Collaborator

@ydshieh ydshieh left a comment

Choose a reason for hiding this comment

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

Thanks @amyeroberts . I don't know we can add ignore at the for for loop line, but I believe you check that is the correct way to do :-)

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Jun 19, 2023

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

@amyeroberts
Copy link
Collaborator Author

@ydshieh Running the doctests (properly this time :) ), the tests pass with the ignore statement on the for loop, and fail without (in the same way as on the CI).

@amyeroberts amyeroberts merged commit 7e71eb2 into huggingface:main Jun 19, 2023
@amyeroberts amyeroberts deleted the fix-imagegpt-doc-tests branch June 19, 2023 14:23
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