From 347d3f92da458520b30e91e56bd66e472e084e70 Mon Sep 17 00:00:00 2001 From: Heiner Lohaus Date: Mon, 25 Mar 2024 21:06:51 +0100 Subject: Add .har file support for OpenaiChat Update model list of HuggingChat Update styles of scrollbar in gui Fix image upload in gui --- g4f/gui/server/api.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'g4f/gui/server') diff --git a/g4f/gui/server/api.py b/g4f/gui/server/api.py index e7683812..11b28dda 100644 --- a/g4f/gui/server/api.py +++ b/g4f/gui/server/api.py @@ -135,6 +135,7 @@ class Api(): camera.take_picture(filename=filename, on_complete=self.on_camera) def on_image_selection(self, filename): + filename = filename[0] if isinstance(filename, list) else filename if filename is not None and os.path.exists(filename): self.image = filename else: @@ -152,7 +153,7 @@ class Api(): window = webview.windows[0] if window is not None: window.evaluate_js( - f"document.querySelector(`.file-label.selected`)?.classList.remove(`selected`);" + f"document.querySelector(`.image-label.selected`)?.classList.remove(`selected`);" ) if input_id is not None and input_id in ("image", "camera"): window.evaluate_js( -- cgit v1.2.3