Commit 7310960
Diffusion export bug fixed for model_index.json (#901)
## What does this PR do?
**Type of change:** Bug fix <!-- Use one of the following: Bug fix, new
feature, new example, new tests, documentation. -->
**Overview:**
Updated diffusers export to preserve the original model_index.json
instead of always rebuilding a minimal one.
The export now uses a simple fallback order: copy original
model_index.json from source path if available, otherwise call
`pipe.save_config(export_dir)`, and only then generate a minimal
model_index.json as last resort.
Non-diffusers export behavior is unchanged.
## Usage
<!-- You can potentially add a usage example below. -->
```python
# Add a code snippet demonstrating how to use this
```
## Testing
<!-- Mention how have you tested your change if applicable. -->
## Before your PR is "*Ready for review*"
<!-- If you haven't finished some of the above items you can still open
`Draft` PR. -->
- **Make sure you read and follow [Contributor
guidelines](https://github.com/NVIDIA/Model-Optimizer/blob/main/CONTRIBUTING.md)**
and your commits are signed.
- **Is this change backward compatible?**: Yes/No <!--- If No, explain
why. -->
- **Did you write any new necessary tests?**: Yes/No
- **Did you add or update any necessary documentation?**: Yes/No
- **Did you update
[Changelog](https://github.com/NVIDIA/Model-Optimizer/blob/main/CHANGELOG.rst)?**:
Yes/No <!--- Only for new features, API changes, critical bug fixes or
bw breaking changes. -->
## Additional Information
<!-- E.g. related issue. -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Bug Fixes**
* Improved Diffusers pipeline export with enhanced model configuration
handling. The export process now better preserves original pipeline
configurations and uses fallback strategies to ensure complete
configuration files are generated.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Signed-off-by: Jingyu Xin <jingyux@nvidia.com>1 parent b46ef75 commit 7310960
1 file changed
Lines changed: 24 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
930 | 930 | | |
931 | 931 | | |
932 | 932 | | |
933 | | - | |
| 933 | + | |
934 | 934 | | |
935 | 935 | | |
936 | | - | |
937 | | - | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
938 | 959 | | |
939 | 960 | | |
940 | 961 | | |
941 | 962 | | |
942 | | - | |
943 | | - | |
944 | | - | |
945 | 963 | | |
946 | 964 | | |
947 | | - | |
948 | 965 | | |
949 | 966 | | |
950 | 967 | | |
| |||
0 commit comments