fix: extract inference results list in UNIPipe.pipe_analyze #1380
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
The UNIPipe.pipe_analyze method was directly using InferenceResult objects as model lists, which caused errors in pipe_parse since it expects an iterable list of inference results. This PR fixes these errors by properly extracting the underlying list data from InferenceResult objects.
Modification
Modified UNIPipe.pipe_analyze to call get_infer_res() on the doc_analyze results before assigning them to model_list. This ensures that model_list contains the actual list of inference results rather than InferenceResult objects, which allows pipe_parse to properly iterate over and process the results.
BC-breaking (Optional)
No BC-breaking changes. This modification fixes a bug in the internal implementation without changing any public APIs or interfaces. Downstream projects will continue to work as expected.
Use cases (Optional)
This is a bug fix that resolves errors when processing PDFs through the UNIPipe pipeline. It does not introduce new features.
Checklist
Before PR:
After PR:
Note: Tests should be added to verify: