mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2025-01-26 20:22:42 +01:00
Load extensions at startup
This commit is contained in:
parent
70e034589f
commit
1d1f931757
@ -231,7 +231,6 @@ def apply_extensions(text, typ):
|
|||||||
for ext in sorted(extension_state, key=lambda x : extension_state[x][1]):
|
for ext in sorted(extension_state, key=lambda x : extension_state[x][1]):
|
||||||
if extension_state[ext][0] == True:
|
if extension_state[ext][0] == True:
|
||||||
ext_string = f"extensions.{ext}.script"
|
ext_string = f"extensions.{ext}.script"
|
||||||
exec(f"import {ext_string}")
|
|
||||||
if typ == "input":
|
if typ == "input":
|
||||||
text = eval(f"{ext_string}.input_modifier(text)")
|
text = eval(f"{ext_string}.input_modifier(text)")
|
||||||
else:
|
else:
|
||||||
@ -258,8 +257,11 @@ extension_state = {}
|
|||||||
if args.extensions is not None:
|
if args.extensions is not None:
|
||||||
for i,ext in enumerate(args.extensions.split(',')):
|
for i,ext in enumerate(args.extensions.split(',')):
|
||||||
if ext in available_extensions:
|
if ext in available_extensions:
|
||||||
print(f'The extension "{ext}" is enabled.')
|
print(f'Loading the extension "{ext}"... ', end='')
|
||||||
|
ext_string = f"extensions.{ext}.script"
|
||||||
|
exec(f"import {ext_string}")
|
||||||
extension_state[ext] = [True, i]
|
extension_state[ext] = [True, i]
|
||||||
|
print(f'Ok.')
|
||||||
|
|
||||||
# Choosing the default model
|
# Choosing the default model
|
||||||
if args.model is not None:
|
if args.model is not None:
|
||||||
|
Loading…
Reference in New Issue
Block a user