Skip to content

Commit 82f8713

Browse files
committed
Print the number of tokens generated
This is useful for verifying the correctness of AttentionSink. Differential Revision: [D65784095](https://our.internmc.facebook.com/intern/diff/D65784095/) [ghstack-poisoned]
1 parent 623a9a6 commit 82f8713

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

examples/models/llama/runner/eager.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,11 @@ def main() -> None:
9191
else runner.text_completion(
9292
prompt=args.prompt,
9393
temperature=args.temperature,
94+
echo=True,
9495
)
9596
)
9697
if args.show_tokens:
97-
print(f"Tokens: {generated_tokens}")
98+
print(f"Generated {len(generated_tokens)} tokens: {generated_tokens}")
9899

99100

100101
if __name__ == "__main__":

0 commit comments

Comments
 (0)