Hi @sam-writer, there’s currently no way to do that with from_pretrained, and I don’t think it will be in the foreseeable future (first of all we would have to choose a runtime for that onnx file, and using onnxruntime forces a lot onto the library, for which transformers is probably not the best place to do).
That being said, if you have a .onnx file on your repo, the best way to use it is with you preferred runtime (onnxruntime most likely).
from huggingface_hub import cached_download

file = cached_download("https://huggingface.co/{USERNAME}/{MODEL_ID}/raw/main/{FILE}.onnx", use_auth_token=os.getenv("API_TOKEN"))

sess = InferenceSession(file)
# go on with inferencing with onnx

Does that help ?