mirror of
https://github.com/ml-explore/mlx-examples.git
synced 2025-08-30 02:53:41 +08:00
fix chinese
This commit is contained in:
parent
9e7c2c1ee7
commit
d8dc7ae7d0
@ -1,7 +1,6 @@
|
|||||||
# Copyright © 2023-2024 Apple Inc.
|
# Copyright © 2023-2024 Apple Inc.
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import codecs
|
|
||||||
import json
|
import json
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
@ -189,7 +188,7 @@ def main():
|
|||||||
elif using_cache:
|
elif using_cache:
|
||||||
tokenizer.chat_template = metadata["chat_template"]
|
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
|
prompt = sys.stdin.read() if prompt == "-" else prompt
|
||||||
if not args.ignore_chat_template and (
|
if not args.ignore_chat_template and (
|
||||||
hasattr(tokenizer, "apply_chat_template")
|
hasattr(tokenizer, "apply_chat_template")
|
||||||
|
Loading…
Reference in New Issue
Block a user