mirror of
https://github.com/ml-explore/mlx-examples.git
synced 2025-06-25 18:11:17 +08:00
Update server.py to add --trust-remote-code to server (#578)
* Update server.py Add --trust-remote-code to server * format code by running pre-commit --------- Co-authored-by: flymonk <zhou.feng@gsafer.com>
This commit is contained in:
parent
2cd793dd69
commit
e2205beb66
@ -432,8 +432,18 @@ if __name__ == "__main__":
|
|||||||
default=8080,
|
default=8080,
|
||||||
help="Port for the HTTP server (default: 8080)",
|
help="Port for the HTTP server (default: 8080)",
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--trust-remote-code",
|
||||||
|
action="store_true",
|
||||||
|
help="Enable trusting remote code for tokenizer",
|
||||||
|
)
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
MODEL, TOKENIZER = load(args.model, adapter_file=args.adapter_file)
|
# Building tokenizer_config
|
||||||
|
tokenizer_config = {"trust_remote_code": True if args.trust_remote_code else None}
|
||||||
|
|
||||||
|
MODEL, TOKENIZER = load(
|
||||||
|
args.model, adapter_file=args.adapter_file, tokenizer_config=tokenizer_config
|
||||||
|
)
|
||||||
|
|
||||||
run(args.host, args.port)
|
run(args.host, args.port)
|
||||||
|
Loading…
Reference in New Issue
Block a user