"...resnet50_tensorflow.git" did not exist on "34d91a7c1591f5b714d2c17515977f57d3652004"
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): ...@@ -302,8 +302,8 @@ class PromptLookupCandidateGenerator(CandidateGenerator):
break break
if chosen_ids is None or len(chosen_ids) == 0: if chosen_ids is None or len(chosen_ids) == 0:
# Need to make a dummy tensor to avoid errors # In case we didn't find a match return the input sequence unchanged, reverts back to autoregressive decoding
chosen_ids = torch.zeros((1), dtype=torch.long, device=input_ids.device) return input_ids, None
# Now need extend input_ids with chosen_ids # Now need extend input_ids with chosen_ids
chosen_ids = chosen_ids.unsqueeze(0) 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