forked from microsoft/Olive
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Complete
io_config
, Pass model to model funcs (microsoft#750)
## Describe your changes `io_config` attribute can take both io_config dict and function names. These cases are not cleanly handled yet. There is a special case where it is a string and is called with `hf_config.model_name`. But this is arbitrary and was initially implemented to make the whisper example work. In this PR: - Handle all possible values for `io_config` attribute. - `PyTorchModel.get_io_config` method is added to get the io config from `io_config` and `hf_config` in decreasing order of priority. - `io_config`, `component_func` and `dummy_input_funcs` are called with `self` by the caller model. This makes them all standardized and not be called with some arbitrary arguments. - `HFConfig` updated to handle io_config and dummy_input creation from onnx config itself. ## Checklist before requesting a review - [x] Add unit tests for this change. - [x] Make sure all tests can pass. - [x] Update documents if necessary. - [x] Lint and apply fixes to your code by running `lintrunner -a` - [x] Is this a user-facing change? If yes, give a description of this change to be included in the release notes. `component_func` and `io_config` functions in `PyTorchModel` are now called with the calling `OliveModel` itself. ## (Optional) Issue link
- Loading branch information
Showing
8 changed files
with
146 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.