From 7d48c5502d7b401c691b7a868fb93090ce3856de Mon Sep 17 00:00:00 2001 From: Paillat Date: Thu, 9 Feb 2023 21:42:17 +0100 Subject: [PATCH] Update makeprompt.py --- code/makeprompt.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/code/makeprompt.py b/code/makeprompt.py index 29b2ab5..d104eba 100644 --- a/code/makeprompt.py +++ b/code/makeprompt.py @@ -148,6 +148,9 @@ To include IMAGES, botator does [image:"here a short title of the image"], then continue break # why is break here? if the try block fails, it will continue to the next iteration of the loop, which will try again. if the try block succeeds, it will break out of the loop. so why is break here? response = response["choices"][0]["text"] + Images_capital = re.findall(r"\[Image:(.*?)\]", response) + #replace all [Image:...] with [image:...] so that we can use the same code for both + for Image_capital in Images_capital: response = response.replace(f"[Image:{Image_capital}]", f"[image:{Image_capital}]") images = re.findall(r"\[image:(.*?)\]", response) files = [] filenames = []