"test/git@developer.sourcefind.cn:gaoqiong/migraphx.git" did not exist on "b6c9202687d6f4358e76b881650d41c9e49d5cb5"
Unverified Commit 0a5b0516 authored by Ofir Zafrir's avatar Ofir Zafrir Committed by GitHub
Browse files

Avoid dummy token in PLD to optimize performance (#29445)

parent 700d48fb
......@@ -302,8 +302,8 @@ class PromptLookupCandidateGenerator(CandidateGenerator):
break
if chosen_ids is None or len(chosen_ids) == 0:
# Need to make a dummy tensor to avoid errors
chosen_ids = torch.zeros((1), dtype=torch.long, device=input_ids.device)
# In case we didn't find a match return the input sequence unchanged, reverts back to autoregressive decoding
return input_ids, None
# Now need extend input_ids with chosen_ids
chosen_ids = chosen_ids.unsqueeze(0)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment