From a3a97120d1fe043f22dd3c546e8b050b415ea593 Mon Sep 17 00:00:00 2001 From: Stephanie Ding Date: Fri, 11 Oct 2024 12:57:08 -0700 Subject: [PATCH] Throw exception if query method is not implemented in query_multimodal_with_retries Summary: as titled Reviewed By: SimonWan Differential Revision: D64257047 fbshipit-source-id: a51136644fc727c9dd0e0a6f4e8e23c87399f6a9 --- CybersecurityBenchmarks/benchmark/llm.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CybersecurityBenchmarks/benchmark/llm.py b/CybersecurityBenchmarks/benchmark/llm.py index 27a0a203..0991fa4b 100644 --- a/CybersecurityBenchmarks/benchmark/llm.py +++ b/CybersecurityBenchmarks/benchmark/llm.py @@ -381,6 +381,11 @@ def query_multimodal_with_retries( self.model, system_prompt, cache_key, response ) return response + except NotImplementedError as exception: + LOG.error( + f"LLM Query failed as the method was not implemented: {exception}" + ) + raise exception except UnretriableQueryException as exception: LOG.error(f"LLM Query failed due to unretriable error: {exception}") return None