diff options
author | Heiner Lohaus <hlohaus@users.noreply.github.com> | 2024-03-19 20:43:51 +0100 |
---|---|---|
committer | Heiner Lohaus <hlohaus@users.noreply.github.com> | 2024-03-19 20:43:51 +0100 |
commit | 0ab7cf71d4000a62b37020d7b739cb4142d85d39 (patch) | |
tree | 574473ed555a0d8362f047c13767df9c0b7d4cac /g4f/gui | |
parent | Fix requirements in gui api (diff) | |
download | gpt4free-0ab7cf71d4000a62b37020d7b739cb4142d85d39.tar gpt4free-0ab7cf71d4000a62b37020d7b739cb4142d85d39.tar.gz gpt4free-0ab7cf71d4000a62b37020d7b739cb4142d85d39.tar.bz2 gpt4free-0ab7cf71d4000a62b37020d7b739cb4142d85d39.tar.lz gpt4free-0ab7cf71d4000a62b37020d7b739cb4142d85d39.tar.xz gpt4free-0ab7cf71d4000a62b37020d7b739cb4142d85d39.tar.zst gpt4free-0ab7cf71d4000a62b37020d7b739cb4142d85d39.zip |
Diffstat (limited to 'g4f/gui')
-rw-r--r-- | g4f/gui/server/api.py | 12 |
1 files changed, 6 insertions, 6 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 |