mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-10-01 01:26:03 -04:00
Check if app should display extensions ui
This commit is contained in:
parent
81c9d130f2
commit
acdbd6b708
@ -46,15 +46,18 @@ def create_extensions_block():
|
|||||||
if _id in shared.settings:
|
if _id in shared.settings:
|
||||||
extension.params[param] = shared.settings[_id]
|
extension.params[param] = shared.settings[_id]
|
||||||
|
|
||||||
|
should_display_ui = False
|
||||||
# Running setup function
|
# Running setup function
|
||||||
if not setup_called:
|
if not setup_called:
|
||||||
for extension, name in iterator():
|
for extension, name in iterator():
|
||||||
if hasattr(extension, "setup"):
|
if hasattr(extension, "setup"):
|
||||||
extension.setup()
|
extension.setup()
|
||||||
|
if hasattr(extension, "ui"):
|
||||||
|
should_display_ui = True
|
||||||
setup_called = True
|
setup_called = True
|
||||||
|
|
||||||
# Creating the extension ui elements
|
# Creating the extension ui elements
|
||||||
if len(state) > 0:
|
if should_display_ui:
|
||||||
with gr.Box(elem_id="extensions"):
|
with gr.Box(elem_id="extensions"):
|
||||||
gr.Markdown("Extensions")
|
gr.Markdown("Extensions")
|
||||||
for extension, name in iterator():
|
for extension, name in iterator():
|
||||||
|
Loading…
Reference in New Issue
Block a user