Skip to content

Commit 06b5159

Browse files
author
ochafik
committed
Avoid print in get_hf_chat_template.py
1 parent 80138d9 commit 06b5159

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/get_hf_chat_template.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def format_variants():
5656
if 'default' not in variants:
5757
raise Exception(f'Please specify a chat template variant (one of {format_variants()})')
5858
variant = 'default'
59-
print(f'Note: picked "default" chat template variant (out of {format_variants()})', file=sys.stderr)
59+
sys.stderr.write(f'Note: picked "default" chat template variant (out of {format_variants()})\n')
6060
elif variant not in variants:
6161
raise Exception(f"Variant {variant} not found in chat template (found {format_variants()})")
6262

@@ -70,7 +70,7 @@ def main(args):
7070
variant = None if len(args) < 2 else args[1]
7171

7272
template = get_hf_chat_template(model_id, variant)
73-
print(template, end=None)
73+
sys.stdout.write(template)
7474

7575

7676
if __name__ == '__main__':

0 commit comments

Comments
 (0)