Skip to content

Commit 45ac6c6

Browse files
author
Tong Li
committed
print results
1 parent 4702d57 commit 45ac6c6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

applications/ColossalChat/coati/distributed/producer.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,11 @@ def __init__(
154154

155155
@torch.no_grad()
156156
def rollout(self, input_ids, attention_mask, **kwargs):
157-
return self.model.generate(input_ids, attention_mask, **kwargs)
157+
rollouts = self.model.generate(input_ids, attention_mask, **kwargs)
158+
if self.producer_idx == 1:
159+
print("Rollout example:\n", self.tokenizer.decode(rollouts["input_ids"][0][0], skip_special_tokens=True))
160+
161+
return rollouts
158162

159163
def load_state_dict(self, state_dict):
160164
self.model.load_state_dict(state_dict)

0 commit comments

Comments
 (0)