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

Gallery improvements #4789

Merged
merged 4 commits into from
Dec 4, 2023
Merged

Conversation

TheLounger
Copy link
Contributor

@TheLounger TheLounger commented Dec 2, 2023

Checklist:

Improvements:

  • Adds the gallery-items_per_page setting, allowing you to control the amount of items in the character gallery before Gradio starts to paginate them.
  • Adds the gallery-open setting, allowing you to open (expand) the character gallery by default.
  • Changes the way character pictures are updated in the chat UI, so they actually update when switching to a different character that has the same name: pfp_character_thumb.png?Jack > pfp_character_thumb.png?Jack_v2_Angry.
  • Adds filtering capability:
    • Keeps a list of loaded character so as to not unnecessarily load them from disk.
    • Highlights textbox when a filter is active.
    • Goes to the first page before filtering, preventing a possible empty page or document jumping around.
    • A button to clear filter.

Notes:

I was hoping to find a simpler way to fix updating the character pic, but I didn't want to create new/temp variables or anything like that and I didn't want unnecessary downloading by slapping on ?{time.time()}, so it is what it is. 🤩

Videos:

(don't seem to embed)
Desktop.webm Android.webm

@oobabooga
Copy link
Owner

Those are excellent changes. Well done!

@oobabooga oobabooga merged commit 7c0a179 into oobabooga:dev Dec 4, 2023
@TheLounger
Copy link
Contributor Author

Thanks for implementing!

The filter feature may need a fix because event handling in Gradio seems to ignore consecutive events when one hasn't finished yet, resulting in unexpected results when you type fast. I believe this needs Gradio 4+ for it to be really fixed (see #1954.

@oobabooga
Copy link
Owner

I tried upgrading to Gradio 4 some weeks ago and it basically broke everything. For now, a search feature that kind works is still better than no search feature at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants