From eb09aba7472aea68f3e0b78950b54e100ce6d7bf Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Fri, 26 Apr 2024 16:49:11 +0530 Subject: [PATCH] Remove quotes wrapping the prompt from being passed to image gen model --- src/khoj/routers/helpers.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/khoj/routers/helpers.py b/src/khoj/routers/helpers.py index 66807cc3..e7392738 100644 --- a/src/khoj/routers/helpers.py +++ b/src/khoj/routers/helpers.py @@ -502,8 +502,11 @@ async def generate_better_image_prompt( with timer("Chat actor: Generate contextual image prompt", logger): response = await send_message_to_model_wrapper(image_prompt, chat_model_option=summarizer_model) + response = response.strip() + if response.startswith(('"', "'")) and response.endswith(('"', "'")): + response = response[1:-1] - return response.strip() + return response async def send_message_to_model_wrapper(