mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2026-04-18 13:03:42 +00:00
UI: do not load the "gallery" extension by default
This commit is contained in:
parent
64a76856bd
commit
168a0f4f67
4 changed files with 19 additions and 8 deletions
|
|
@ -3,9 +3,14 @@ from pathlib import Path
|
|||
import gradio as gr
|
||||
|
||||
from modules.html_generator import get_image_cache
|
||||
from modules.shared import gradio, settings
|
||||
from modules.shared import gradio
|
||||
|
||||
|
||||
params = {
|
||||
'items_per_page': 50,
|
||||
'open': False,
|
||||
}
|
||||
|
||||
cards = []
|
||||
|
||||
|
||||
|
|
@ -104,7 +109,7 @@ def custom_js():
|
|||
|
||||
|
||||
def ui():
|
||||
with gr.Accordion("Character gallery", open=settings["gallery-open"], elem_id='gallery-extension'):
|
||||
with gr.Accordion("Character gallery", open=params["open"], elem_id='gallery-extension'):
|
||||
gr.HTML(value="<style>" + generate_css() + "</style>")
|
||||
with gr.Row():
|
||||
filter_box = gr.Textbox(label='', placeholder='Filter', lines=1, max_lines=1, container=False, elem_id='gallery-filter-box')
|
||||
|
|
@ -116,7 +121,7 @@ def ui():
|
|||
label="",
|
||||
samples=generate_html(),
|
||||
elem_classes=["character-gallery"],
|
||||
samples_per_page=settings["gallery-items_per_page"]
|
||||
samples_per_page=params["items_per_page"]
|
||||
)
|
||||
|
||||
filter_box.change(lambda: None, None, None, js=f'() => {{{custom_js()}; gotoFirstPage()}}').success(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue