diff --git a/launch.py b/launch.py index fdd2fcba7..aeb3a1475 100755 --- a/launch.py +++ b/launch.py @@ -128,7 +128,7 @@ def gb(val: float): process = psutil.Process(os.getpid()) res = process.memory_info() ram_total = 100 * res.rss / process.memory_percent() - return f'used={gb(res.rss)} total={gb(ram_total)}' + return f'{gb(res.rss)}/{gb(ram_total)}' def start_server(immediate=True, server=None): @@ -145,7 +145,7 @@ def start_server(immediate=True, server=None): if not immediate: time.sleep(3) if collected > 0: - installer.log.debug(f'Memory {get_memory_stats()} Collected {collected}') + installer.log.debug(f'Memory: {get_memory_stats()} collected={collected}') module_spec = importlib.util.spec_from_file_location('webui', 'webui.py') server = importlib.util.module_from_spec(module_spec) installer.log.debug(f'Starting module: {server}') @@ -233,7 +233,7 @@ def start_server(immediate=True, server=None): if round(time.time()) % 120 == 0: state = f'job="{instance.state.job}" {instance.state.job_no}/{instance.state.job_count}' if instance.state.job != '' or instance.state.job_no != 0 or instance.state.job_count != 0 else 'idle' uptime = round(time.time() - instance.state.server_start) - installer.log.debug(f'Server alive={alive} jobs={instance.state.total_jobs} requests={requests} uptime={uptime} memory {get_memory_stats()} {state}') + installer.log.debug(f'Server: alive={alive} jobs={instance.state.total_jobs} requests={requests} uptime={uptime} memory={get_memory_stats()} backend={instance.backend} {state}') if not alive: if uv is not None and uv.wants_restart: installer.log.info('Server restarting...') diff --git a/modules/ui.py b/modules/ui.py index ee490a87d..507e628f6 100644 --- a/modules/ui.py +++ b/modules/ui.py @@ -1239,11 +1239,14 @@ def webpath(fn): def html_head(): - script_js = os.path.join(script_path, "javascript", "script.js") - head = f'\n' + head = '' + main = ['script.js'] + for js in main: + script_js = os.path.join(script_path, "javascript", js) + head += f'\n' added = [] for script in modules.scripts.list_scripts("javascript", ".js"): - if script.path == script_js: + if script.filename in main: continue head += f'\n' added.append(script.path) diff --git a/webui.py b/webui.py index 8397aced3..5b0692ed2 100644 --- a/webui.py +++ b/webui.py @@ -44,6 +44,7 @@ pass state = shared.state +backend = shared.backend if not modules.loader.initialized: timer.startup.record("libraries") log.setLevel(logging.DEBUG if cmd_opts.debug else logging.INFO) @@ -274,7 +275,7 @@ def start_ui(): shared.log.info(f'API Docs: {local_url[:-1]}/docs') # pylint: disable=unsubscriptable-object if share_url is not None: shared.log.info(f'Share URL: {share_url}') - shared.log.debug(f'Gradio registered functions: {len(shared.demo.fns)}') + shared.log.debug(f'Gradio functions: registered={len(shared.demo.fns)}') shared.demo.server.wants_restart = False setup_middleware(app, cmd_opts)