mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-22 08:07:56 +01: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:
|
||||
extension.params[param] = shared.settings[_id]
|
||||
|
||||
should_display_ui = False
|
||||
# Running setup function
|
||||
if not setup_called:
|
||||
for extension, name in iterator():
|
||||
if hasattr(extension, "setup"):
|
||||
extension.setup()
|
||||
if hasattr(extension, "ui"):
|
||||
should_display_ui = True
|
||||
setup_called = True
|
||||
|
||||
# Creating the extension ui elements
|
||||
if len(state) > 0:
|
||||
if should_display_ui:
|
||||
with gr.Box(elem_id="extensions"):
|
||||
gr.Markdown("Extensions")
|
||||
for extension, name in iterator():
|
||||
|
Loading…
Reference in New Issue
Block a user