Skip to content

Commit

Permalink
feat(code): improve concat of strings in ui (#1785)
Browse files Browse the repository at this point in the history
  • Loading branch information
igeni authored Apr 2, 2024
1 parent ea153fb commit bac818a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions private_gpt/ui/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit bac818a

Please sign in to comment.