Skip to content

Commit

Permalink
Revert Python example changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kunal-vaishnavi committed Jan 31, 2025
1 parent 6cb82de commit 2a40334
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion examples/python/model-chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,11 @@ def main(args):

if args.timings: started_timestamp = time.time()

prompt = f'{args.chat_template.format(input=text)}'
# If there is a chat template, use it
prompt = text
if args.chat_template:
prompt = f'{args.chat_template.format(input=text)}'

input_tokens = tokenizer.encode(prompt)

generator.append_tokens(input_tokens)
Expand Down
6 changes: 5 additions & 1 deletion examples/python/model-qa.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,11 @@ def main(args):

if args.timings: started_timestamp = time.time()

prompt = f'{args.chat_template.format(input=text)}'
# If there is a chat template, use it
prompt = text
if args.chat_template:
prompt = f'{args.chat_template.format(input=text)}'

input_tokens = tokenizer.encode(prompt)

generator.append_tokens(input_tokens)
Expand Down

0 comments on commit 2a40334

Please sign in to comment.