Fix requirements in gui api

This commit is contained in:
Heiner Lohaus 2024-03-19 20:43:51 +01:00
parent a6ab2adaf0
commit 0ab7cf71d4
2 changed files with 6 additions and 21 deletions

View File

@ -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

15
main.py
View File

@ -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);