Skip to content

Fix TypeScript type errors in Lfm2VlImageProcessor and MgpstrProcessor - #1785

Open
dpfens wants to merge 1 commit into
huggingface:mainfrom
dpfens:fix-type-errors
Open

dpfens wants to merge 1 commit into
huggingface:mainfrom
dpfens:fix-type-errors

Conversation

@dpfens

@dpfens dpfens commented Sep 30, 2026

Copy link
Copy Markdown

Summary

Fixes TypeScript compilation errors in #1784 in Lfm2VlImageProcessor and MgpstrProcessor that were causing the build to fail.

Changes

Lfm2VlImageProcessor

  • Added Lfm2VlImageProcessorResult typedef that extends ImageProcessorResult with additional properties (pixel_attention_mask, spatial_shapes, and optional image_rows, image_cols, image_sizes)
  • Added proper JSDoc return type annotation to _call method: @returns {Promise<Lfm2VlImageProcessorResult>}
  • Fixed array type declarations for all_image_sizes and all_original_sizes from number[][] to HeightWidth[] to match the expected tuple type
  • Removed incorrect Record<string, any> type annotation on result object

MgpstrProcessor

  • Renamed batch_decode to decode_logits to avoid conflict with base class method
  • Updated JSDoc to clarify the method converts model prediction logits (not token ids)
  • Updated corresponding test calls to use the new method name

Testing

  • pnpm build completes successfully without TypeScript errors
  • Existing tests pass

This branch has not been deployed

No deployments
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.

1 participant