Skip to content

Fix invalid property #39384

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

Merged
merged 2 commits into from
Jul 15, 2025
Merged

Fix invalid property #39384

merged 2 commits into from
Jul 15, 2025

Conversation

cyyever
Copy link
Contributor

@cyyever cyyever commented Jul 13, 2025

What does this PR do?

ruff detects some invalid property definitions. This PR fixes them.

Signed-off-by: cyy <cyyever@outlook.com>
@cyyever cyyever force-pushed the invalid_property branch from 1c4e4af to e3a60bb Compare July 13, 2025 10:35
Copy link
Contributor

[For maintainers] Suggested jobs to run (before merge)

run-slow: gptq, higgs

@Rocketknight1
Copy link
Member

Hi @cyyever, I'm not sure what makes those type hints invalid! I know that after from __future__ import annotations that we can just do Optional[PreTrainedModel], but the existing hints are correct until then, right?

@cyyever
Copy link
Contributor Author

cyyever commented Jul 15, 2025

@Rocketknight1 Python properties should not accept other parameters than self, they are not used.

@Rocketknight1
Copy link
Member

Oh, I see! I completely misread, I thought this was about the type hint. You're entirely correct!

@Rocketknight1 Rocketknight1 enabled auto-merge (squash) July 15, 2025 11:59
@Rocketknight1 Rocketknight1 merged commit f03b384 into huggingface:main Jul 15, 2025
25 checks passed
@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.

@cyyever cyyever deleted the invalid_property branch July 15, 2025 13:18
rjgleaton pushed a commit to rjgleaton/transformers that referenced this pull request Jul 17, 2025
Signed-off-by: cyy <cyyever@outlook.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