Skip to content

zero_shot_object_detection ValueError fix for python 3.13#45669

Merged
Rocketknight1 merged 1 commit intohuggingface:mainfrom
AnkitAhlawat7742:fix/zero_shot_doctest
Apr 28, 2026
Merged

zero_shot_object_detection ValueError fix for python 3.13#45669
Rocketknight1 merged 1 commit intohuggingface:mainfrom
AnkitAhlawat7742:fix/zero_shot_doctest

Conversation

@AnkitAhlawat7742
Copy link
Copy Markdown
Contributor

What does this PR do?

Python 3.13's doctest parser enforces stricter syntax validation. The closing )[0] is placed on a ... continuation line, which is no longer accepted so this PR fixes the malformed doctest by splitting the indexing into a separate statement, making it compatible with Python 3.13's parser while keeping the same behavior.

Fixes #45657

Code Agent Policy

  • I confirm that this is not a pure code agent PR.

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?

Who can review?

Documentation: @stevhliu

Copy link
Copy Markdown
Member

@Rocketknight1 Rocketknight1 left a comment

Choose a reason for hiding this comment

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

LGTM!

@Rocketknight1 Rocketknight1 enabled auto-merge April 28, 2026 11:24
@Rocketknight1 Rocketknight1 added this pull request to the merge queue Apr 28, 2026
@HuggingFaceDocBuilderDev
Copy link
Copy Markdown

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.

Merged via the queue into huggingface:main with commit aadc005 Apr 28, 2026
17 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.

ValueError in zero_shot_object_detection.md doctest on Python 3.13

3 participants