From bac818add51b104cda925b8f1f7b51448e935ca1 Mon Sep 17 00:00:00 2001 From: igeni Date: Tue, 2 Apr 2024 17:42:40 +0300 Subject: [PATCH] feat(code): improve concat of strings in ui (#1785) --- private_gpt/ui/ui.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/private_gpt/ui/ui.py b/private_gpt/ui/ui.py index 7c34e8497..7ba1c1ff2 100644 --- a/private_gpt/ui/ui.py +++ b/private_gpt/ui/ui.py @@ -103,12 +103,12 @@ def yield_deltas(completion_gen: CompletionGen) -> Iterable[str]: sources_text = "\n\n\n" used_files = set() for index, source in enumerate(cur_sources, start=1): - if (source.file + "-" + source.page) not in used_files: + if f"{source.file}-{source.page}" not in used_files: sources_text = ( sources_text + f"{index}. {source.file} (page {source.page}) \n\n" ) - used_files.add(source.file + "-" + source.page) + used_files.add(f"{source.file}-{source.page}") full_response += sources_text yield full_response