-
Notifications
You must be signed in to change notification settings - Fork 378
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
Make optimized ONNX external data files downloadable from Hugging Face Hub #1725
base: main
Are you sure you want to change the base?
Make optimized ONNX external data files downloadable from Hugging Face Hub #1725
Conversation
This commit renames the downloaded Hugging Face model data file from "${file_name}_data" to "${file_name}.data". This change aligns the file naming convention with other downloaded model data files in the project, improving consistency and clarity.
Hi @kazssym, Optimum ONNX export uses |
When I stored my external data file as DELETED |
Thank you @kazssym, I am not sure to understand. Could you open an issue about that with a reproduction of the issue? For example, optimum-cli export onnx --model saibo/llama-1B llama_onnx followed by from optimum.onnxruntime import ORTModelForCausalLM
model = ORTModelForCausalLM.from_pretrained("/path/to/llama_onnx") works for me. |
I tried to upload an exported ONNX model to Hugging Face Hub and let it be downloaded with Optimum. I must upload it with Then I renamed the file with |
@kazssym Thanks, let me try. |
I found it needs more changes for this problem and switched this PR to draft now. |
Issue #1736 |
This reverts commit c59d942.
This commit updates how Optimum handles external data files associated with Hugging Face models loaded from the Hub. - Previously: Only the `_data` suffix was checked for downloading external files. - Change: The code now iterates through both `"_data"` and `.data"` suffixes to ensure compatibility with models that might use either convention. This update improves robustness by accommodating models that save external data with different suffixes.
Updated this PR to cope with this case: optimum/optimum/onnxruntime/optimization.py Line 225 in fd47a73
|
What does this PR do?
This PR adds
.data
to the external data file suffixes so that an optimized model can be downloaded from Hugging Face as the optimizer saves models with.data
instead of_data
.Fixes # (issue)
Before submitting