Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(qwen): add trust_remote_code argument support #2493

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions examples/qwen/convert_checkpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,10 @@ def parse_arguments():
help=
'N-way expert parallelism size for MOE, default is 1, which will do tp-only for MoE'
)
parser.add_argument(
"--trust_remote_code",
action="store_true",
help="Pass trust_remote_code=True to HF loading functions as needed")
args = parser.parse_args()
return args

Expand Down Expand Up @@ -233,6 +237,7 @@ def convert_and_save_hf(args):
mapping=mapping,
quant_config=quant_config,
calib_dataset=args.calib_dataset,
trust_remote_code=args.trust_remote_code,
**override_fields)
else:

Expand All @@ -249,6 +254,7 @@ def convert_and_save_rank(args, rank):
mapping=mapping,
quant_config=quant_config,
use_hf_gptq_checkpoint=use_hf_gptq_checkpoint,
trust_remote_code=args.trust_remote_code,
**override_fields)
qwen.save_checkpoint(args.output_dir, save_config=(rank == 0))
del qwen
Expand Down