mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2026-04-08 16:13:41 +00:00
Refactor to not import gradio in --nowebui mode
This commit is contained in:
parent
970055ca00
commit
39e6c997cc
7 changed files with 232 additions and 209 deletions
|
|
@ -6,8 +6,6 @@ from functools import partial
|
|||
from inspect import signature
|
||||
from pathlib import Path
|
||||
|
||||
import gradio as gr
|
||||
|
||||
import modules.shared as shared
|
||||
from modules.logging_colors import logger
|
||||
|
||||
|
|
@ -214,6 +212,7 @@ def _apply_custom_js():
|
|||
|
||||
|
||||
def create_extensions_block():
|
||||
import gradio as gr
|
||||
to_display = []
|
||||
for extension, name in iterator():
|
||||
if hasattr(extension, "ui") and not (hasattr(extension, 'params') and extension.params.get('is_tab', False)):
|
||||
|
|
@ -228,6 +227,7 @@ def create_extensions_block():
|
|||
|
||||
|
||||
def create_extensions_tabs():
|
||||
import gradio as gr
|
||||
for extension, name in iterator():
|
||||
if hasattr(extension, "ui") and (hasattr(extension, 'params') and extension.params.get('is_tab', False)):
|
||||
display_name = getattr(extension, 'params', {}).get('display_name', name)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue