From 8c43c43eb9ef19b98a36f78cc4c9d2b217309a47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maria=20Gabriela=20Boh=C3=B3rquez?= Date: Sun, 29 Oct 2023 14:12:01 -0300 Subject: [PATCH] Keep dots --- app/routes/dialogue.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/routes/dialogue.py b/app/routes/dialogue.py index 2b23cfa..7efe8f9 100644 --- a/app/routes/dialogue.py +++ b/app/routes/dialogue.py @@ -29,7 +29,7 @@ def get_openai_lines(prompt: str): temperature=0.8, ) - lines = [re.sub(r"[^a-zA-Z0-9 ']", '', item.strip()) for item in response.choices[0].message.content.split("\n") if item != ""] + lines = [re.sub(r"[^a-zA-Z0-9 '.]", '', item.strip()) for item in response.choices[0].message.content.split("\n") if item != ""] return DialogueResponse( lines=lines @@ -45,7 +45,7 @@ def get_llama_lines(prompt: str): response = [item for item in response if item != ""] response = "".join(response).split("\n") # Llama needs some cleaning up for the response, very difficult to remove via prompt. - response = [re.sub(r"[^a-zA-Z0-9 ']", '', item[2:].strip()) for item in response if item != ""] + response = [re.sub(r"[^a-zA-Z0-9 '.]", '', item[2:].strip()) for item in response if item != ""] response.pop(0) return DialogueResponse(lines=response)