Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: further improve duplicate loggig #749

Merged
merged 5 commits into from
Oct 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions memium/source/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ def tags(self) -> Sequence[str]:
@property
def title(self) -> str:
return self.source_path.stem

def __repr__(self) -> str:
return f"{self.title}: {self.content[0:10]}..."
7 changes: 6 additions & 1 deletion memium/source/prompt_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,12 @@ def _deduplicate_group(self, group: tuple[str, Sequence[BasePrompt]]) -> BasePro
if prompts_in_group[0].edit_url
else prompts_in_group[0]
)
log.warning(f"Found duplicate prompts for {identifier}. Prompts: {prompts_in_group}")
log.warning(
f"""{identifier} has duplicate prompts:
Prompts:
{(' '*8).join(prompts_in_group.__repr__())}
"""
)

return prompts_in_group[0]

Expand Down