Skip to content

Commit

Permalink
Replace deepcopy with copy to optimize performance
Browse files Browse the repository at this point in the history
  • Loading branch information
sinking-point committed Oct 2, 2023
1 parent e897e67 commit 8d1fbc2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/transformers/generation/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4479,7 +4479,7 @@ def assisted_decoding(
# we use this forward pass to also pick the subsequent logits in the original model.

# 2.1. Prepare the model inputs
candidate_kwargs = copy.deepcopy(model_kwargs)
candidate_kwargs = copy.copy(model_kwargs)
candidate_kwargs = self._extend_attention_mask(candidate_kwargs, candidate_input_ids.shape[1])
candidate_kwargs = self._extend_token_type_ids(candidate_kwargs, candidate_input_ids.shape[1])

Expand Down

0 comments on commit 8d1fbc2

Please sign in to comment.