Skip to content

Commit dc40152

Browse files
committed
debug
1 parent 8130901 commit dc40152

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

torchchat/generate.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,15 +324,20 @@ def prefill(
324324
width = x.size(1)
325325
assert input_pos.size(0) == width
326326
print("x: ", x, "input_pos: ", input_pos, "width: ", width)
327+
print("sequential_prefill: ", sequential_prefill)
327328

328329
if sequential_prefill:
329330
for i in range(width):
331+
print("i: ", i)
330332
x_sliced, ip_sliced = x[:, i].view(-1, 1), input_pos[i].view(-1)
333+
print("x_sliced: ", x_sliced, "ip_sliced: ", ip_sliced)
331334
# logging.debug(f"<sliced> x: {x_sliced}, input_pos: {ip_sliced}")
332335
logits = model(x_sliced, ip_sliced) # (x[:, i], input_pos[i])
336+
print("logits: ", logits)
333337
else:
334338
# input_pos: [B, S]
335339
logits = model(x, input_pos)
340+
print("logits: ", logits)
336341
# print(f"logits {logits.shape}")
337342

338343
# print(f"x: {x},\n input_pos: {input_pos}\n")

0 commit comments

Comments
 (0)