Skip to content
This repository was archived by the owner on Sep 10, 2025. It is now read-only.

Commit 3b550f1

Browse files
committed
simplify decode step, remove old comments
1 parent 844e908 commit 3b550f1

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

dist_run.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -246,13 +246,8 @@ def _update_padded_sequence(
246246

247247
# Decode token id into string and print it
248248
def _decode_in_flight(token, tokenizer, tp_rank):
249-
# Make a 2D tensor with ids on row dimension
250-
# unsqueezed = torch.unsqueeze(token, 1)
251-
# token_str = tokenizer.decode(unsqueezed.tolist())
252-
# tiktoken does not accept tensor inputs
253-
decoding_list = token.tolist()
254-
token_str = tokenizer.decode(decoding_list)
255-
249+
"""decode token ids for all prompts in the batch and log them"""
250+
token_str = tokenizer.decode(token.tolist())
256251
# print the token string on tp rank 0
257252
if tp_rank == 0:
258253
logger.info(

0 commit comments

Comments
 (0)