Is there a way to add trust_remote_code=True param to the convert app? otherwise, cannot convert.

#17
by PengZhang424242 - opened

For some models cannot convert due to not to set trust_remote_code=True.

ONNX Community org

Yes, it's possible. I've added the parameter to the execution of the script.
Please try now and let us know if it worked.

ONNX Community org

@Felladrin Just a reminder than this may be used be a malicious actor to obtain the HF_TOKEN used for uploading. For that reason, I disabled it again for now until we have a better solution for conversion: https://huggingface.co/spaces/onnx-community/convert-to-onnx/commit/98ae8d1555c7ebf7193255fd1aed23130941079f

ONNX Community org

Got it, @Xenova ! I hope we can find better way to do this.

ONNX Community org

just have a toggle for the parameter?

ONNX Community org

i did it: https://huggingface.co/spaces/onnx-community/convert-to-onnx/discussions/19

@1TSnakers , that’s a great idea! I also liked the warning you added.

I’m okay with that, as long as the user is required to use their own Access Token if the “trust_remote_code” toggle is enabled. Could you make this change?
Currently, inputting the access token is optional. If the token is empty, the access token used is the one set in the environment variable, which has write access to https://huggingface.co/spaces/onnx-community.

What do you think, @Xenova ?

ONNX Community org

updated!

ONNX Community org

Thanks, @1TSnakers ! The PR looks good to me. But we'll also need @Xenova 's approval on this one.

Sign up or log in to comment