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

fix(mm): do not erroneously rename files #5914

Merged
merged 2 commits into from Mar 10, 2024

Conversation

psychedelicious
Copy link
Collaborator

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update
  • Community Node Submission

Have you discussed this change with the InvokeAI team?

  • Yes
  • No, because:

Description

Two fixes:

  1. fix(mm): fix models.yaml backup filename

Was erroneously models.bak, now models.yaml.bak

  1. fix(mm): models lose file extension when syncing

We were stripping the file extension from file models when moving them in _sync_model_path. For example, some_model.safetensors would be moved to some_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

Was erroneously `models.bak`, now `models.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 to `some_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.
@github-actions github-actions bot added python PRs that change python files services PRs that change app services labels Mar 10, 2024
@psychedelicious psychedelicious merged commit 9376b13 into main Mar 10, 2024
14 checks passed
@psychedelicious psychedelicious deleted the psyche/fix/mm-rename-files branch March 10, 2024 02:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python PRs that change python files services PRs that change app services
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants