Skip to content

[MPNet] Refactor output tracing using capture_outputs decorator#44056

Open
aman-coder03 wants to merge 7 commits intohuggingface:mainfrom
aman-coder03:refactor-mpnet-output-capture
Open

[MPNet] Refactor output tracing using capture_outputs decorator#44056
aman-coder03 wants to merge 7 commits intohuggingface:mainfrom
aman-coder03:refactor-mpnet-output-capture

Conversation

@aman-coder03
Copy link
Copy Markdown

@aman-coder03 aman-coder03 commented Feb 16, 2026

What does this PR do?

This PR migrates MPNet to the new standardized output tracing system using the @capture_outputs decorator.

Specifically, this PR:

  • Applies @capture_outputs to MPNetModel.forward
  • Removes manual accumulation of hidden_states and attentions
  • Simplifies encoder output handling by relying on decorator-based tracing
  • Preserves compatibility with BaseModelOutput and return_dict behavior
  • Reduces boilerplate and improves maintainability

Why is this needed?

This aligns MPNet with the new standardized output tracing framework introduced in #43979 and removes legacy manual output collection logic.

@aman-coder03 aman-coder03 force-pushed the refactor-mpnet-output-capture branch from 7db5623 to 5d80a56 Compare February 17, 2026 08:07
@aman-coder03 aman-coder03 changed the title Refactor MPNet output capturing using capture_outputs decorator [MPNet] Refactor output tracing using capture_outputs decorator Feb 17, 2026
@aman-coder03 aman-coder03 force-pushed the refactor-mpnet-output-capture branch from 5d80a56 to 00099b9 Compare February 17, 2026 11:12
@github-actions
Copy link
Copy Markdown
Contributor

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

run-slow: mpnet

@aman-coder03 aman-coder03 force-pushed the refactor-mpnet-output-capture branch from 8b98e1e to e48e74c Compare February 17, 2026 11:18
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