nemo_rl.environments.nemotron_utils#
Module Contents#
Functions#
Return the SFT/vLLM-compatible |
|
Resize one frame with the same numeric order as stock vLLM. |
|
Replace locally decoded frame items with ordered |
|
Match vLLM’s timestamped one-wrapper-per-tubelet video replacement. |
|
Port the source branch’s dynamic video-frame preprocessing contract. |
Data#
API#
- nemo_rl.environments.nemotron_utils.NEMOTRON_VIDEO_PROCESSOR_NAMES#
‘frozenset(…)’
- nemo_rl.environments.nemotron_utils._required_config_value(config: Any, name: str) Any#
- nemo_rl.environments.nemotron_utils.load_nemotron_video_model_config(model_name: str) Any#
- nemo_rl.environments.nemotron_utils._nemotron_video_target_resolution(
- *,
- original_width: int,
- original_height: int,
- target_num_patches: int,
- patch_size: int,
- downsample_ratio: float,
- maintain_aspect_ratio: bool,
Return the SFT/vLLM-compatible
(width, height)for a video frame.
- nemo_rl.environments.nemotron_utils._resize_and_normalize_nemotron_video_frame(
- frame: PIL.Image.Image,
- *,
- target_height: int,
- target_width: int,
- norm_mean: torch.Tensor,
- norm_std: torch.Tensor,
Resize one frame with the same numeric order as stock vLLM.
- nemo_rl.environments.nemotron_utils._flatten_nemotron_video_frame_messages(
- messages: list[dict[str, Any]],
Replace locally decoded frame items with ordered
<image>markers.
- nemo_rl.environments.nemotron_utils._render_nemotron_video_prompt(
- processor: Any,
- messages: list[dict[str, Any]],
- template_kwargs: dict[str, Any],
- nemo_rl.environments.nemotron_utils._expand_nemotron_video_placeholders(
- rendered_text: str,
- *,
- embeddings_per_tubelet: list[int],
- frame_indices: list[int],
- fps: float,
- temporal_patch_size: int,
Match vLLM’s timestamped one-wrapper-per-tubelet video replacement.
- nemo_rl.environments.nemotron_utils.process_nemotron_video_frames(
- processor: Any,
- messages: list[dict[str, Any]],
- *,
- template_kwargs: dict[str, Any],
- temporal_patch_size: int,
- target_num_patches: int,
- maintain_aspect_ratio: bool,
Port the source branch’s dynamic video-frame preprocessing contract.