feat: Add video support for the Transformers backend (#57441)
pre-commit / pre-run-check (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s

Signed-off-by: Harshal Janjani <harshaljanjani@gmail.com>
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Co-authored-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Harshal Janjani
2026-10-05 00:51:15 -07:00
committed by GitHub
co-authored by Harry Mellor Claude Opus 5
parent 042ab0305c
commit 34051ad714
9 changed files with 775 additions and 115 deletions
+4 -4
View File
@@ -683,15 +683,15 @@ def patch_rope_parameters(config: PreTrainedConfig) -> None:
config.validate_rope()
def _iter_rope_parameters(config: PreTrainedConfig) -> Iterator[dict[str, Any]]:
def iter_rope_parameters(config: PreTrainedConfig) -> Iterator[dict[str, Any]]:
"""Yield a config's rope parameters, one dict per layer type if nested."""
rope_parameters = getattr(config, "rope_parameters", None)
if not isinstance(rope_parameters, dict):
return
if is_rope_parameters_nested(rope_parameters):
yield from (p for p in rope_parameters.values() if isinstance(p, dict))
else:
yield from (p for p in rope_parameters.values() if isinstance(p, dict) and p)
elif rope_parameters:
yield rope_parameters
@@ -705,7 +705,7 @@ def _mrope_section(config: PreTrainedConfig) -> Sequence[int] | None:
names = ("mrope_section", "xdrope_section")
for params in _iter_rope_parameters(config):
for params in iter_rope_parameters(config):
for i, name in enumerate(names):
section = params.get(name)
if isinstance(section, (list, tuple)):