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

Infer whether a model needs to be exported to ONNX or not #2181

Merged
merged 44 commits into from
Feb 12, 2025
Merged

Conversation

echarlaix
Copy link
Collaborator

@echarlaix echarlaix commented Feb 4, 2025

Infer whether the model should be exported or not by checking whether a .onnx file is present when loading the model, removing the need to specify the export argument

  from optimum.onnxruntime import ORTModelForCausalLM

  model_id = "optimum-internal-testing/tiny-random-llama"
- model = ORTModelForCausalLM.from_pretrained(model_id, export=True)
+ model = ORTModelForCausalLM.from_pretrained(model_id)

@echarlaix echarlaix changed the title Infer export Add _find_files_matching_pattern to infer export Feb 4, 2025
@echarlaix echarlaix marked this pull request as ready for review February 4, 2025 17:18
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@echarlaix echarlaix changed the title Add _find_files_matching_pattern to infer export Infer whether a model needs to be exported to ONNX or not Feb 6, 2025
@echarlaix
Copy link
Collaborator Author

Failing tests unrelated so merging

@echarlaix echarlaix merged commit 6335599 into main Feb 12, 2025
28 of 30 checks passed
@echarlaix echarlaix deleted the infer-export branch February 12, 2025 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants