Skip to content

Commit

Permalink
fix: fixed bug in refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikBjare committed Sep 26, 2024
1 parent 9808166 commit 43f912e
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions gptme/logmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,21 +177,19 @@ def prepare_messages(self) -> list[Message]:
@classmethod
def load(
cls,
logfile: PathLike,
logdir: PathLike,
initial_msgs: list[Message] | None = None,
branch: str = "main",
create: bool = False,
**kwargs,
) -> "LogManager":
"""Loads a conversation log."""
logsdir = get_logs_dir()
if str(logsdir) not in str(logfile):
if str(logsdir) not in str(logdir):
# if the path was not fully specified, assume its a dir in logsdir
logdir = logsdir / logfile
logdir = logsdir / logdir
else:
logdir = Path(logfile).parent
if logdir.name == "branches":
logdir = logdir.parent
logdir = Path(logdir)

if branch == "main":
logfile = logdir / "conversation.jsonl"
Expand Down

0 comments on commit 43f912e

Please sign in to comment.