+
Skip to content

Conversation

bsowell
Copy link
Contributor

@bsowell bsowell commented Jun 4, 2025

This makes additional customization possible that is otherwise difficult.

This change should have no impact on current behavior.

This makes additional customization possible that is otherwise difficult.
@bsowell bsowell requested review from Copilot and karanataryn June 4, 2025 23:13
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for a custom supplement_text function in the partitioner, allowing users to override the default text-supplementation behavior.

  • Updated the type imports to include Callable.
  • Introduced a new parameter, supplement_text_fn, in the process_batch function signature.
  • Replaced the direct call to self._supplement_text with the new supplement_text_fn call, preserving existing behavior via a default.
Comments suppressed due to low confidence (1)

lib/sycamore/sycamore/transforms/detr_partitioner.py:449

  • Consider adding a docstring or inline comment for the supplement_text_fn parameter to clarify its purpose, expected inputs, and behavior.
supplement_text_fn: Callable[[list[Element], list[Element]], list[Element]] = _supplement_text,

@karanataryn karanataryn merged commit 6893434 into main Jun 5, 2025
12 of 15 checks passed
@karanataryn karanataryn deleted the ben/custom_supplement_text branch June 5, 2025 00:19
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

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载