-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Update textual_inversion.py #6952
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
Conversation
Hi @sayakpaul, can you please review this PR. I will create the notebook and model_card sample and will update this PR. |
Let me know once the PR is updated. |
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
Hi @sayakpaul, i saw some notebooks for generating the model cards but I'm having some issues. Is there any template to follow to generate these model cards or how we have to do it? |
The notebooks use the same |
Hi @sayakpaul, I have added the notebook link and also made a change in textual_inversion.py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Bhavay-2001 I think you are copying over the changes from the reference PRs without looking into the original method implementations.
For example, for textual_inversion.py
, we don't pass image_logs
to save_model_card()
, we pass images
. These things shouldn't be changed.
def save_model_card(repo_id: str, image_logs: dict =None, base_model: str=None, repo_folder: str=None): | ||
img_str = "" | ||
for i, image in enumerate(images): | ||
image.save(os.path.join(repo_folder, f"image_{i}.png")) | ||
for i, log in enumerate(image_logs): | ||
images = log["images"] | ||
validation_prompt = log["validation_prompt"] | ||
validation_image = log["validation_image"] | ||
validation_image.save(os.path.join(repo_folder, "image_control.png")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you changing these lines?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @sayakpaul, I just want to know do we only need images and not validation_prompts in case of textual_inversions? I have used the validation_prompts as well that's why added this code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That update shouldn't be necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we only want to use images then I think what needs to be changed and I will do that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @sayakpaul, soo the image.save()
function should remain as it is in the code right? And the validation_prompts are just for generating the outputs in collaboratory right?
Hi @sayakpaul, I have made the final changes. Can you please check and confirm and merge? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have left a suggestion. And once the styling problems have been fixed, we can merge.
Co-authored-by: Sayak Paul <[email protected]>
Done |
We need to fix the code qualities. |
What does this PR do?
Part of #6891 for Textual_Inversion
Notebook Link - here
Before submitting
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
@sayakpaul