mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-22 08:07:56 +01:00
Fix loading extensions from within the interface
This commit is contained in:
parent
304f812c63
commit
1edfb96778
@ -7,7 +7,7 @@ import modules.shared as shared
|
|||||||
|
|
||||||
state = {}
|
state = {}
|
||||||
available_extensions = []
|
available_extensions = []
|
||||||
setup_called = False
|
setup_called = set()
|
||||||
|
|
||||||
def load_extensions():
|
def load_extensions():
|
||||||
global state
|
global state
|
||||||
@ -53,13 +53,12 @@ def create_extensions_block():
|
|||||||
should_display_ui = False
|
should_display_ui = False
|
||||||
|
|
||||||
# Running setup function
|
# Running setup function
|
||||||
if not setup_called:
|
for extension, name in iterator():
|
||||||
for extension, name in iterator():
|
if hasattr(extension, "ui"):
|
||||||
if hasattr(extension, "setup"):
|
should_display_ui = True
|
||||||
extension.setup()
|
if extension not in setup_called and hasattr(extension, "setup"):
|
||||||
if hasattr(extension, "ui"):
|
setup_called.add(extension)
|
||||||
should_display_ui = True
|
extension.setup()
|
||||||
setup_called = True
|
|
||||||
|
|
||||||
# Creating the extension ui elements
|
# Creating the extension ui elements
|
||||||
if should_display_ui:
|
if should_display_ui:
|
||||||
|
Loading…
Reference in New Issue
Block a user