Skip to content

Conversation

@zucchini-nlp
Copy link
Member

What does this PR do?

As per title, these helpers are used in vLLM and don't work if we save a processor after v5. Now all processor's subcomponents are saved in one single place in processor_config.json, so we need to check it as well when trying to locate the config file

fyi @hmellor

@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
Contributor

@molbap molbap left a comment

Choose a reason for hiding this comment

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

Thanks, looks fine to me! just a couple questions

@zucchini-nlp
Copy link
Member Author

Oke, now it works. We have to load both (legacy vs non-legacy) configs and then decide which one takes priority because it depends on their content

Copy link
Contributor

@molbap molbap left a comment

Choose a reason for hiding this comment

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

Re-approving after re-reading 😁 thanks for the iteration, not much except proposing to refacto the json opening a bit as many repeated bits

Comment on lines 210 to 211
except json.JSONDecodeError:
raise OSError(f"It looks like the config file at '{resolved_processor_file}' is not a valid JSON file.")
Copy link
Contributor

Choose a reason for hiding this comment

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

could be another exception type, why not capture and re-raise as part of the message?

Copy link
Member Author

Choose a reason for hiding this comment

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

i see it was always raising a clear message for only for incorrectly serialized files, while other types of Errors are raised as is. So I decided to leave it as is, but in general we can just fallback to json's own errors for all cases. I think they are pretty straighforward to understand

Copy link
Member Author

Choose a reason for hiding this comment

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

maybe in the future

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah agreed, json own error handling is robust

Co-authored-by: Pablo Montalvo <39954772+molbap@users.noreply.github.com>
@github-actions
Copy link
Contributor

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

run-slow: auto

@zucchini-nlp zucchini-nlp merged commit 5150dac into huggingface:main Nov 13, 2025
23 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.

3 participants