diff --git a/g4f/Provider/needs_auth/OpenaiChat.py b/g4f/Provider/needs_auth/OpenaiChat.py index 740c7c50..6e8b51f5 100644 --- a/g4f/Provider/needs_auth/OpenaiChat.py +++ b/g4f/Provider/needs_auth/OpenaiChat.py @@ -162,7 +162,7 @@ class OpenaiChat(AsyncAuthedProvider, ProviderModelMixin): hasher.update(data_bytes) image_hash = hasher.hexdigest() cache_file = ImagesCache.get(image_hash) - if cls.image_cache and file: + if cls.image_cache and cache_file: debug.log("Using cached image") return ImageRequest(cache_file) extension, mime_type = detect_file_type(data_bytes)