Subtract 1 from Variable upper bound (#10715)

This commit is contained in:
Sieds Lykles
2025-06-09 18:25:53 +02:00
committed by GitHub
parent ef58ab340a
commit cfa65bea05

View File

@@ -56,7 +56,7 @@ if __name__ == "__main__":
with Profiling(sort="time", frac=0.1, enabled=args.profile):
with Timing("total ", enabled=args.timing, on_exit=lambda x: f", {1e9/x:.2f} tok/sec"):
with WallTimeEvent(BenchEvent.STEP):
tok = model(Tensor([toks[start_pos:]]), 0 if start_pos == 0 else Variable("start_pos", 1, 1024).bind(start_pos), args.temperature).item()
tok = model(Tensor([toks[start_pos:]]), 0 if start_pos == 0 else Variable("start_pos", 1, 1024-1).bind(start_pos), args.temperature).item()
toks.append(tok)
start_pos += 1
print(spp.decode(toks))