From b5b56f35caf584ec92e50998979aa8bc065f67d5 Mon Sep 17 00:00:00 2001 From: Heiner Lohaus Date: Sun, 17 Mar 2024 10:51:08 +0100 Subject: Fix abort in webview --- g4f/gui/__init__.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'g4f/gui/__init__.py') diff --git a/g4f/gui/__init__.py b/g4f/gui/__init__.py index dff720ac..3f695200 100644 --- a/g4f/gui/__init__.py +++ b/g4f/gui/__init__.py @@ -1,12 +1,13 @@ from ..errors import MissingRequirementsError -try: - from .server.app import app - from .server.website import Website - from .server.backend import Backend_Api -except ImportError: - raise MissingRequirementsError('Install "flask" package for the gui') def run_gui(host: str = '0.0.0.0', port: int = 8080, debug: bool = False) -> None: + try: + from .server.app import app + from .server.website import Website + from .server.backend import Backend_Api + except ImportError: + raise MissingRequirementsError('Install "flask" package for the gui') + if debug: import g4f g4f.debug.logging = True -- cgit v1.2.3