bridge.models.deepseek.data.collate_fn#
DeepSeek text-chat collators.
Module Contents#
Functions#
Add the omitted content field used by OpenAI tool-call-only turns. |
|
Render and tokenize one DeepSeek-V4 chat row with the official encoder. |
|
Collate DeepSeek-V4 chats without synthesizing a Jinja template. |
API#
- bridge.models.deepseek.data.collate_fn._deepseek_v4_options(
- example: collections.abc.Mapping[str, Any],
- bridge.models.deepseek.data.collate_fn._normalize_deepseek_v4_conversation(
- example_or_conversation: collections.abc.Mapping[str, Any] | collections.abc.Sequence[collections.abc.Mapping[str, Any]],
Add the omitted content field used by OpenAI tool-call-only turns.
- bridge.models.deepseek.data.collate_fn._attach_tools(
- conversation: list[dict[str, Any]],
- tools: collections.abc.Sequence[collections.abc.Mapping[str, Any]] | None,
- bridge.models.deepseek.data.collate_fn.tokenize_deepseek_v4_example(
- example_or_conversation: collections.abc.Mapping[str, Any] | collections.abc.Sequence[collections.abc.Mapping[str, Any]],
- processor: Any,
- *,
- max_length: int | None = None,
- skipped_tokens: torch.Tensor | None = None,
- boundary_config: megatron.bridge.data.conversation_processing.AssistantMaskBoundaryConfig | None = None,
- warn_on_all_masked: bool = True,
- loss_mode: Literal[assistant, last_turn, full] = 'assistant',
- **_: Any,
Render and tokenize one DeepSeek-V4 chat row with the official encoder.
- bridge.models.deepseek.data.collate_fn.deepseek_v4_collate_fn(
- examples: list[collections.abc.Mapping[str, Any]],
- processor: Any,
- *,
- sequence_length: int | None = None,
- max_length: int | None = None,
- pad_to_max_length: bool = False,
- pad_to_multiple_of: int = 1,
- warn_on_all_masked: bool = True,
- loss_mode: Literal[assistant, last_turn, full] = 'assistant',
- enable_in_batch_packing: bool = False,
- in_batch_packing_pad_to_multiple_of: int = 1,
- **kwargs: Any,
Collate DeepSeek-V4 chats without synthesizing a Jinja template.