mirror of
https://github.com/vladmandic/automatic
synced 2026-08-26 15:16:01 +02:00
update gradio and enhance tracebacks
This commit is contained in:
Submodule extensions-builtin/sd-extension-system-info updated: 32e205d074...0794afa25c
+2
-2
@@ -6,7 +6,7 @@ import uvicorn
|
||||
import gradio as gr
|
||||
from threading import Lock
|
||||
from io import BytesIO
|
||||
from gradio.processing_utils import decode_base64_to_file
|
||||
from gradio_client.utils import decode_base64_to_file
|
||||
from fastapi import APIRouter, Depends, FastAPI, Request, Response
|
||||
from fastapi.security import HTTPBasic, HTTPBasicCredentials
|
||||
from fastapi.exceptions import HTTPException
|
||||
@@ -570,7 +570,7 @@ class Api:
|
||||
def create_hypernetwork(self, args: dict):
|
||||
try:
|
||||
shared.state.begin()
|
||||
filename = create_hypernetwork(**args) # create empty embedding
|
||||
filename = create_hypernetwork(**args) # create empty embedding # pylint: disable=E1111
|
||||
shared.state.end()
|
||||
return CreateResponse(info = "create hypernetwork filename: {filename}".format(filename = filename))
|
||||
except AssertionError as e:
|
||||
|
||||
+12
-6
@@ -4,27 +4,33 @@ import starlette
|
||||
import gradio
|
||||
from rich import print
|
||||
from rich.console import Console
|
||||
from rich.theme import Theme
|
||||
from rich.pretty import install as pretty_install
|
||||
from rich.traceback import install as traceback_install
|
||||
|
||||
console = Console(log_time=True, log_time_format='%H:%M:%S-%f')
|
||||
console = Console(log_time=True, log_time_format='%H:%M:%S-%f', theme=Theme({
|
||||
"traceback.border": "black",
|
||||
"traceback.border.syntax_error": "black",
|
||||
"inspect.value.border": "black",
|
||||
}))
|
||||
pretty_install(console=console)
|
||||
traceback_install(console=console, extra_lines=1, width=console.width, word_wrap=False, indent_guides=False, suppress=[anyio, starlette, gradio])
|
||||
already_displayed = {}
|
||||
|
||||
def install():
|
||||
pretty_install(console=console)
|
||||
traceback_install(console=console, extra_lines=1, width=console.width, word_wrap=False, indent_guides=False, suppress=[anyio, starlette, gradio])
|
||||
|
||||
|
||||
def print_error_explanation(message):
|
||||
lines = message.strip().split("\n")
|
||||
max_len = max([len(x) for x in lines])
|
||||
print('=' * max_len, file=sys.stderr)
|
||||
for line in lines:
|
||||
print(line, file=sys.stderr)
|
||||
print('=' * max_len, file=sys.stderr)
|
||||
|
||||
|
||||
def display(e: Exception, task):
|
||||
print(f"{task or 'error'}: {type(e).__name__}", file=sys.stderr)
|
||||
console.print_exception(show_locals=False, max_frames=2, extra_lines=1, suppress=[anyio, starlette, gradio], word_wrap=False, width=min([console.width, 200]))
|
||||
console.print_exception(show_locals=False, max_frames=2, extra_lines=1, suppress=[anyio, starlette, gradio], theme="ansi_dark", word_wrap=False, width=min([console.width, 200]))
|
||||
|
||||
|
||||
def display_once(e: Exception, task):
|
||||
@@ -42,4 +48,4 @@ def run(code, task):
|
||||
|
||||
|
||||
def exception():
|
||||
console.print_exception(show_locals=False, max_frames=10, extra_lines=2, suppress=[anyio, starlette, gradio], word_wrap=False, width=min([console.width, 200]))
|
||||
console.print_exception(show_locals=False, max_frames=10, extra_lines=2, suppress=[anyio, starlette, gradio], theme="ansi_dark", word_wrap=False, width=min([console.width, 200]))
|
||||
|
||||
@@ -15,6 +15,7 @@ import modules.devices as devices
|
||||
from modules import script_loading, errors, ui_components, shared_items, cmd_args, errors
|
||||
from modules.paths_internal import models_path, script_path, data_path, sd_configs_path, sd_default_config, sd_model_file, default_sd_model_file, extensions_dir, extensions_builtin_dir
|
||||
|
||||
errors.install()
|
||||
demo = None
|
||||
from setup import log as setup_log # pylint: disable=E0611
|
||||
log = setup_log
|
||||
|
||||
+3
-3
@@ -20,6 +20,7 @@ future
|
||||
gdown
|
||||
gfpgan
|
||||
GitPython
|
||||
gradio_client
|
||||
httpcore
|
||||
inflection
|
||||
jsonmerge
|
||||
@@ -54,10 +55,9 @@ transformers
|
||||
voluptuous
|
||||
yapf
|
||||
|
||||
diffusers==0.14.0
|
||||
diffusers==0.15.0
|
||||
einops==0.4.1
|
||||
fastapi==0.94.0
|
||||
gradio==3.23.0
|
||||
gradio==3.26.0
|
||||
numexpr==2.8.4
|
||||
pandas==1.5.3
|
||||
protobuf==3.20.3
|
||||
|
||||
@@ -29,11 +29,16 @@ def setup_logging():
|
||||
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s | %(levelname)s | %(pathname)s | %(message)s', filename='setup.log', filemode='a', encoding='utf-8', force=True)
|
||||
try: # we may not have rich on the first run
|
||||
from rich import print
|
||||
from rich.theme import Theme
|
||||
from rich.logging import RichHandler
|
||||
from rich.console import Console
|
||||
from rich.pretty import install as pretty_install
|
||||
from rich.traceback import install as traceback_install
|
||||
console = Console(log_time=True, log_time_format='%H:%M:%S-%f')
|
||||
console = Console(log_time=True, log_time_format='%H:%M:%S-%f', theme=Theme({
|
||||
"traceback.border": "black",
|
||||
"traceback.border.syntax_error": "black",
|
||||
"inspect.value.border": "black",
|
||||
}))
|
||||
pretty_install(console=console)
|
||||
traceback_install(console=console, extra_lines=1, width=console.width, word_wrap=False, indent_guides=False, suppress=[])
|
||||
rh = RichHandler(show_time=True, omit_repeated_times=False, show_level=True, show_path=False, markup=False, rich_tracebacks=True, log_time_format='%H:%M:%S-%f', level=logging.DEBUG if args.debug else logging.INFO, console=console)
|
||||
@@ -372,7 +377,6 @@ def run_setup(quick = False):
|
||||
install_repositories()
|
||||
install_submodules()
|
||||
install_extensions()
|
||||
install_requirements()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user