Skip to content

Commit

Permalink
Fixed Message type
Browse files Browse the repository at this point in the history
  • Loading branch information
maykcaldas committed Dec 18, 2024
1 parent 420203b commit 31419c8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ldp/alg/optimizer/ape.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,9 @@ def aggregate_trajectory(self, trajectory: Trajectory) -> None:
continue
# (x: first prompt's user message's content, y: AI response's content)
x = next(
cast(str, m.content) for m in result.prompt if m.role == "user"
cast(str, m.content)
for m in result.prompt
if (isinstance(m, Message) and m.role == "user")
)
y = cast(str, result.messages[0].content)

Expand Down

0 comments on commit 31419c8

Please sign in to comment.