Skip to content

Populate last_hidden_state in the output of feature extraction model class#863

Merged
zhenchaoni merged 1 commit into
mainfrom
private/zhenni/fix_feature_extraction
Jun 10, 2026
Merged

Populate last_hidden_state in the output of feature extraction model class#863
zhenchaoni merged 1 commit into
mainfrom
private/zhenni/fix_feature_extraction

Conversation

@zhenchaoni

@zhenchaoni zhenchaoni commented Jun 10, 2026

Copy link
Copy Markdown
Member

Fixes a regression introduced from #805

In #805, we removed the last_hidden_state output from the model class output and return whatever output provided by the underlying onnx model.

But this causes a regression. The composite model class encoder_decoder expects the encoder model to have last_hidden_state output. This output is treated as the encoded values. However, some models doesn't have this output name. Therefore, the encoder decoder loop will fail.

The fix is to provide last_hidden_state if the underlying onnx model uses a different output name.

@zhenchaoni zhenchaoni requested a review from a team as a code owner June 10, 2026 08:35
@zhenchaoni zhenchaoni changed the title Fix feature extraction Populate last_hidden_state in the output of feature extraction model class Jun 10, 2026
@zhenchaoni zhenchaoni merged commit 2247974 into main Jun 10, 2026
9 checks passed
@zhenchaoni zhenchaoni deleted the private/zhenni/fix_feature_extraction branch June 10, 2026 08:47
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.

2 participants