From bc42adbeeee0ea7f7e789ca8072cfbda93f78e3e Mon Sep 17 00:00:00 2001 From: Goran Gligorin Date: Sun, 16 Jun 2024 22:44:53 +0200 Subject: [PATCH] fix(bot): fix a bug where references was a string instead of an array --- bot.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bot.py b/bot.py index 964510f..4f69b61 100644 --- a/bot.py +++ b/bot.py @@ -62,6 +62,12 @@ def process_fn( """ references = item.get("references", []) + # check if references is a string + if isinstance(references, str): + references = [references] + # filter out empty strings + references = [ref for ref in references if ref] + model = item["model"] messages = item["instruction"]