Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions evalution/engines/transformers.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ def _processor_init_with_fa2_cb_graph_fix(self: Any, *args: Any, **kwargs: Any)
False,
):
@wraps(current_generation_step)
def _generation_step_with_fa2_cb_graph_fix(self: Any, model: Any) -> None:
def _generation_step_with_fa2_cb_graph_fix(self: Any, *args: Any, **kwargs: Any) -> None:
"""Implement generation step with fa2 cb graph fix for this module."""

original_use_cuda_graph = getattr(self, "use_cuda_graph", False)
Expand All @@ -479,7 +479,11 @@ def _generation_step_with_fa2_cb_graph_fix(self: Any, model: Any) -> None:
else self.use_cuda_graph_varlen
)
try:
current_generation_step(self, model)
# Keep compatibility across transformers versions where
# _generation_step signatures differ:
# - old: _generation_step(self, model, logit_processor)
# - new: _generation_step(self, model)
current_generation_step(self, *args, **kwargs)
finally:
self.use_cuda_graph = original_use_cuda_graph

Expand Down