Add Interface mode tab
This commit is contained in:
parent
b50172255a
commit
4d64a57092
4 changed files with 213 additions and 175 deletions
|
@ -11,9 +11,12 @@ def load_extensions():
|
|||
for i, name in enumerate(shared.args.extensions):
|
||||
if name in available_extensions:
|
||||
print(f'Loading the extension "{name}"... ', end='')
|
||||
exec(f"import extensions.{name}.script")
|
||||
state[name] = [True, i]
|
||||
print('Ok.')
|
||||
try:
|
||||
exec(f"import extensions.{name}.script")
|
||||
state[name] = [True, i]
|
||||
print('Ok.')
|
||||
except:
|
||||
print('Fail.')
|
||||
|
||||
# This iterator returns the extensions in the order specified in the command-line
|
||||
def iterator():
|
||||
|
@ -42,8 +45,9 @@ def create_extensions_block():
|
|||
extension.params[param] = shared.settings[_id]
|
||||
|
||||
# Creating the extension ui elements
|
||||
with gr.Box(elem_id="extensions"):
|
||||
gr.Markdown("Extensions")
|
||||
for extension, name in iterator():
|
||||
if hasattr(extension, "ui"):
|
||||
extension.ui()
|
||||
if len(state) > 0:
|
||||
with gr.Box(elem_id="extensions"):
|
||||
gr.Markdown("Extensions")
|
||||
for extension, name in iterator():
|
||||
if hasattr(extension, "ui"):
|
||||
extension.ui()
|
||||
|
|
|
@ -19,6 +19,9 @@ gradio = {}
|
|||
# Generation input parameters
|
||||
input_params = []
|
||||
|
||||
# For restarting the interface
|
||||
need_restart = False
|
||||
|
||||
settings = {
|
||||
'max_new_tokens': 200,
|
||||
'max_new_tokens_min': 1,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue