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

Improve error message for mismatched copies in code blocks #31535

Merged
merged 1 commit into from
Jun 25, 2024

Conversation

molbap
Copy link
Contributor

@molbap molbap commented Jun 21, 2024

What does this PR do?

Very tiny PR to improve error message and include the filename of the culprit in the traceback. Stumbled upon a case where attributes set before __init__ would raise this error.

cc @ydshieh @ArthurZucker

# Copied from transformers...
class MyNewModel():
    attribute = "foo"  # will break check-copies but not point to this class
    def __init__(self...

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

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 for the improvement!

@ydshieh ydshieh requested a review from amyeroberts June 24, 2024 15:40
Copy link
Collaborator

@amyeroberts amyeroberts left a comment

Choose a reason for hiding this comment

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

Thanks for this improvement 💪

Copy link
Collaborator

@amyeroberts amyeroberts left a comment

Choose a reason for hiding this comment

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

oops -sorry - meant to hit approve

@molbap molbap merged commit aab0829 into huggingface:main Jun 25, 2024
8 checks passed
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.

4 participants