summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH Lohaus <hlohaus@users.noreply.github.com>2024-03-19 20:45:35 +0100
committerGitHub <noreply@github.com>2024-03-19 20:45:35 +0100
commitcef44edbde45e6646bb4acb4e9b76e4abe630627 (patch)
tree722324a6e86669044083b25d0bee1fe179f6fb35
parentMerge pull request #1728 from hlohaus/giga (diff)
parentFix requirements in gui api (diff)
downloadgpt4free-cef44edbde45e6646bb4acb4e9b76e4abe630627.tar
gpt4free-cef44edbde45e6646bb4acb4e9b76e4abe630627.tar.gz
gpt4free-cef44edbde45e6646bb4acb4e9b76e4abe630627.tar.bz2
gpt4free-cef44edbde45e6646bb4acb4e9b76e4abe630627.tar.lz
gpt4free-cef44edbde45e6646bb4acb4e9b76e4abe630627.tar.xz
gpt4free-cef44edbde45e6646bb4acb4e9b76e4abe630627.tar.zst
gpt4free-cef44edbde45e6646bb4acb4e9b76e4abe630627.zip
-rw-r--r--g4f/gui/server/api.py12
-rw-r--r--main.py15
2 files changed, 6 insertions, 21 deletions
diff --git a/g4f/gui/server/api.py b/g4f/gui/server/api.py
index ed904be8..3adb88f4 100644
--- a/g4f/gui/server/api.py
+++ b/g4f/gui/server/api.py
@@ -13,8 +13,13 @@ try:
from plyer import camera
from plyer import filechooser
app_storage_path = platformdirs.user_pictures_dir
+ user_select_image = partial(
+ filechooser.open_file,
+ path=platformdirs.user_pictures_dir(),
+ filters=[["Image", "*.jpg", "*.jpeg", "*.png", "*.webp", "*.svg"]],
+ )
has_plyer = True
-except ImportError:
+except (ImportError, NameError):
has_plyer = False
try:
from android.runnable import run_on_ui_thread
@@ -26,11 +31,6 @@ try:
has_android = True
except ImportError:
run_on_ui_thread = lambda a : a
- user_select_image = partial(
- filechooser.open_file,
- path=platformdirs.user_pictures_dir(),
- filters=[["Image", "*.jpg", "*.jpeg", "*.png", "*.webp", "*.svg"]],
- )
has_android = False
from g4f import version, models
diff --git a/main.py b/main.py
deleted file mode 100644
index 5b2cc4c2..00000000
--- a/main.py
+++ /dev/null
@@ -1,15 +0,0 @@
-import ssl
-import certifi
-from functools import partial
-
-ssl.default_ca_certs = certifi.where()
-ssl.create_default_context = partial(
- ssl.create_default_context,
- cafile=certifi.where()
-)
-
-from g4f.gui.webview import run_webview
-import g4f.debug
-g4f.debug.version_check = False
-
-run_webview(True); \ No newline at end of file