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): model names with periods may install to wrong location #7117

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

psychedelicious
Copy link
Collaborator

Summary

When we provide a config object during a model install, the config can override individual fields that would otherwise be derived programmatically. We use this to install starter models w/ a given name, description, etc.

This logic used pathlib to append a suffix to the model's name. When we provide a model name that has a period in it, pathlib splits the name at the period and replaces everything after it with the suffix. This is then used to determine the output path of the model.

As a result, some starter model paths are incorrect. For example, IP Adapter SD1.5 Image Encoder gets installed to sd-1/clip_vision/IP Adapter SD1.

Related Issues / Discussions

n/a

QA Instructions

Delete the SD1.5 IP Adapter and its CLIP vision model. Reinstall them. Should work fine. I don't think there will be any other effects from this change but probably good to get a review from @lstein and @brandonrising .

Merge Plan

n/a

Checklist

  • The PR has a short but descriptive title, suitable for a changelog
  • Tests added / updated (if applicable)
  • Documentation added / updated (if applicable)

When we provide a config object during a model install, the config can override individual fields that would otherwise be derived programmatically. We use this to install starter models w/ a given name, description, etc.

This logic used `pathlib` to append a suffix to the model's name. When we provide a model name that has a period in it, `pathlib` splits the name at the period and replaces everything after it with the suffix. This is then used to determine the output path of the model.

As a result, some starter model paths are incorrect. For example, `IP Adapter SD1.5 Image Encoder` gets installed to `sd-1/clip_vision/IP Adapter SD1`.
@github-actions github-actions bot added python PRs that change python files services PRs that change app services labels Oct 15, 2024
@psychedelicious psychedelicious changed the title fix(mm): model names with periods borked fix(mm): model names with periods may install to wrong location Oct 15, 2024
@brandonrising
Copy link
Collaborator

Is there a reason the file name needs to match the model name? If it's just to more easily find the model while looking through the model directory, I'd almost rather just use the model key as the filename.

I can't find a specific model name that breaks with this implementation, but it definitely introduces the possibility of saving a file with an unintended file extension that some OS out there doesn't like 🤔

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.

4 participants