From e7d464d65e8fe3a40f5a1555c2ddafd0765bebb1 Mon Sep 17 00:00:00 2001 From: Griesshaber Daniel <griesshaber@hdm-stuttgart.de> Date: Wed, 23 Oct 2024 10:41:23 +0200 Subject: [PATCH] use different quotes in fstring nesting --- evoprompt/evolution/evolution.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/evoprompt/evolution/evolution.py b/evoprompt/evolution/evolution.py index e57e681..5204ef1 100644 --- a/evoprompt/evolution/evolution.py +++ b/evoprompt/evolution/evolution.py @@ -111,7 +111,7 @@ class EvolutionAlgorithm(PromptOptimization, metaclass=ABCMeta): # TODO another option would be to select the first match that is not equal to " and " (which is part of the instruction and usually repeated in the response) matches = re.findall( # regex that matches any characters between last pair of `start_token` and `end_token`, and optionally allow missing `end_token` - rf"{start_token}(?!.*{start_token})(?:(.*){end_token}{"|(.*)" if allow_missing_end_token else ""})", + rf"{start_token}(?!.*{start_token})(?:(.*){end_token}{'|(.*)' if allow_missing_end_token else ''})", response, flags=(re.IGNORECASE | re.DOTALL), ) -- GitLab