fix(mm): do not erroneously rename files #5914
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What type of PR is this? (check all applicable)
Have you discussed this change with the InvokeAI team?
Description
Two fixes:
Was erroneously
models.bak
, nowmodels.yaml.bak
We were stripping the file extension from file models when moving them in
_sync_model_path
. For example,some_model.safetensors
would be moved tosome_model
, which of course breaks things.Instead of using the model's name as the new path, use the model's path's last segment. This is the same behaviour for directories, but for files, it retains the file extension.
QA Instructions, Screenshots, Recordings
The issue was kinda side-stepped in 67163c2, but the root issue still existed.
To test this, back up your models directory, then check out f01e81d (the commit immediately before 67163c2).
Start up the app, and we expect to see a message that models are being moved. We expect to see all your non-diffusers models be renamed to have no file extension.
Then, restore your backed up models directory, check out this PR's branch and start the app. You should have no models moved or renamed.
Merge Plan
This PR can be merged when approved