diff options
author | Heiner Lohaus <hlohaus@users.noreply.github.com> | 2024-03-17 10:51:08 +0100 |
---|---|---|
committer | Heiner Lohaus <hlohaus@users.noreply.github.com> | 2024-03-17 10:51:08 +0100 |
commit | b5b56f35caf584ec92e50998979aa8bc065f67d5 (patch) | |
tree | e5dc449b76ac83c350a0932dde5118d57c73d803 /g4f/gui/webview.py | |
parent | Fix Provider not found error (diff) | |
download | gpt4free-b5b56f35caf584ec92e50998979aa8bc065f67d5.tar gpt4free-b5b56f35caf584ec92e50998979aa8bc065f67d5.tar.gz gpt4free-b5b56f35caf584ec92e50998979aa8bc065f67d5.tar.bz2 gpt4free-b5b56f35caf584ec92e50998979aa8bc065f67d5.tar.lz gpt4free-b5b56f35caf584ec92e50998979aa8bc065f67d5.tar.xz gpt4free-b5b56f35caf584ec92e50998979aa8bc065f67d5.tar.zst gpt4free-b5b56f35caf584ec92e50998979aa8bc065f67d5.zip |
Diffstat (limited to 'g4f/gui/webview.py')
-rw-r--r-- | g4f/gui/webview.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/g4f/gui/webview.py b/g4f/gui/webview.py index a8e745f3..ba764947 100644 --- a/g4f/gui/webview.py +++ b/g4f/gui/webview.py @@ -1,3 +1,5 @@ +import sys +import os.path import webview try: from platformdirs import user_config_dir @@ -14,9 +16,13 @@ def run_webview( debug: bool = False, storage_path: str = None ): + if getattr(sys, 'frozen', False): + dirname = sys._MEIPASS + else: + dirname = os.path.dirname(__file__) webview.create_window( f"g4f - {g4f.version.utils.current_version}", - "client/index.html", + os.path.join(dirname, "client/index.html"), text_select=True, js_api=Api(), ) |