mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-22 16:17:57 +01:00
Update extensions.py
This commit is contained in:
parent
acdbd6b708
commit
8fad84abc2
@ -1,3 +1,5 @@
|
|||||||
|
import traceback
|
||||||
|
|
||||||
import gradio as gr
|
import gradio as gr
|
||||||
|
|
||||||
import extensions
|
import extensions
|
||||||
@ -18,6 +20,7 @@ def load_extensions():
|
|||||||
print('Ok.')
|
print('Ok.')
|
||||||
except:
|
except:
|
||||||
print('Fail.')
|
print('Fail.')
|
||||||
|
traceback.print_exc()
|
||||||
|
|
||||||
# This iterator returns the extensions in the order specified in the command-line
|
# This iterator returns the extensions in the order specified in the command-line
|
||||||
def iterator():
|
def iterator():
|
||||||
@ -38,6 +41,7 @@ def apply_extensions(text, typ):
|
|||||||
|
|
||||||
def create_extensions_block():
|
def create_extensions_block():
|
||||||
global setup_called
|
global setup_called
|
||||||
|
|
||||||
# Updating the default values
|
# Updating the default values
|
||||||
for extension, name in iterator():
|
for extension, name in iterator():
|
||||||
if hasattr(extension, 'params'):
|
if hasattr(extension, 'params'):
|
||||||
@ -47,6 +51,7 @@ def create_extensions_block():
|
|||||||
extension.params[param] = shared.settings[_id]
|
extension.params[param] = shared.settings[_id]
|
||||||
|
|
||||||
should_display_ui = False
|
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():
|
||||||
|
Loading…
Reference in New Issue
Block a user