fix chinese

This commit is contained in:
Awni Hannun 2024-12-16 12:21:22 -08:00
parent 9e7c2c1ee7
commit d8dc7ae7d0

View File

@ -1,7 +1,6 @@
# Copyright © 2023-2024 Apple Inc.
import argparse
import codecs
import json
import sys
@ -189,7 +188,7 @@ def main():
elif using_cache:
tokenizer.chat_template = metadata["chat_template"]
prompt = codecs.decode(args.prompt, "unicode_escape")
prompt = args.prompt.replace("\\n", "\n").replace("\\t", "\t")
prompt = sys.stdin.read() if prompt == "-" else prompt
if not args.ignore_chat_template and (
hasattr(tokenizer, "apply_chat_template")