This commit is contained in:
somebody
2023-04-27 19:33:03 -05:00
parent f9d162c001
commit b256a8fbc7
2 changed files with 2 additions and 0 deletions

View File

@@ -122,6 +122,7 @@ class Stoppers:
input_ids: torch.LongTensor,
) -> bool:
print(f"[stop_sequence_stopper] Input ids: {input_ids}")
data = [model.tokenizer.decode(x) for x in input_ids]
# null_character = model.tokenizer.encode(chr(0))[0]
if "completed" not in model.gen_state:

View File

@@ -28,6 +28,7 @@ class GenericTokenizer:
return ret.ids
def decode(self, tokens: Union[int, List[int], torch.Tensor]) -> str:
print(f"[decode] Tokens: {tokens}")
if isinstance(tokens, torch.Tensor):
tokens = tokens.cpu().tolist()