From 2940dce0cfc07e0671c77ae48837b4f24e11c0da Mon Sep 17 00:00:00 2001 From: AllentDan Date: Fri, 6 Dec 2024 10:26:51 +0800 Subject: [PATCH] fix with deep copy --- lmdeploy/pytorch/engine/engine.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lmdeploy/pytorch/engine/engine.py b/lmdeploy/pytorch/engine/engine.py index b66ab61ac..263ef784e 100644 --- a/lmdeploy/pytorch/engine/engine.py +++ b/lmdeploy/pytorch/engine/engine.py @@ -838,7 +838,7 @@ def __update_inputs(next_token_ids): retrieve_indices) = self.model_agent.generate_candidates( spec_logits, next_token_ids) bs, _, tree_decode_len = tree_candidates.shape - spec_inputs = inputs + spec_inputs = copy.deepcopy(inputs) spec_inputs.input_ids = tree_candidates.flatten().unsqueeze(0) spec_inputs.history_lengths += spec_inputs.seq_length spec_inputs.seq_length = torch.ones_like(