-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit d534cb9
Feat/apply gui improvements to manual captioning (#3347)
* feat: Apply Gradio GUI improvements to manual_caption_gui.py
This commit applies the same Gradio GUI improvements that were done in `kintext_manual_caption_gui.py` to `manual_caption_gui.py`.
The changes include:
- Better user feedback for status updates.
- Safer return values from functions to avoid clearing user input on errors.
- A more organized layout with better-labeled components.
- Clearer pagination controls.
* refactor: Align manual_caption_gui.py with new standards
This commit refactors the `manual_caption_gui.py` file to align with the new standards set by the `kontext_manual_caption_gui.py` file.
The changes include:
- Performance and Efficiency: Use of `os.path.basename`, `os.scandir`, and `gr.State` to improve performance.
- Code Quality and Readability: Case-insensitive tag matching, sorted tags, and improved variable names.
- UI and User Experience: Refined UI layout, consolidated pagination logic, and improved error handling.
* fix: Correct pagination display issue
This commit fixes a bug in the pagination logic that was causing the incorrect page count to be displayed. The `page.change` event handler has been updated to correctly update the `page_count` component when the page number or the total number of pages changes.
* fix: Correct pagination and resolve ValueError
This commit fixes a bug in the pagination logic that was causing the incorrect page count to be displayed. The `page.change` event handler has been updated to correctly update the `page_count` component when the page number or the total number of pages changes.
This commit also resolves a `ValueError` that was occurring in the `render_pagination_with_logic` function. The `page.change` event handler has been updated to return a tuple of two `gr.Text` components, which resolves the error.
* fix: Correct pagination on initial load
This commit fixes a bug where the pagination would not display the correct number of pages on the initial load. A `max_page.change` event handler has been added to both `manual_caption_gui.py` and `kontext_manual_caption_gui.py` to ensure the page count is updated correctly.
* Update gui layout
---------
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>1 parent 12640ff commit d534cb9Copy full SHA for d534cb9
File tree
Expand file treeCollapse file tree
2 files changed
+302
-526
lines changedFilter options
- kohya_gui
Expand file treeCollapse file tree
2 files changed
+302
-526
lines changed
0 commit comments