-
Notifications
You must be signed in to change notification settings - Fork 507
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
Update save_conversations
tool
#1421
Conversation
@@ -65,13 +66,83 @@ def _load_sft_dataset( | |||
return dataset | |||
|
|||
|
|||
def _split_message_list_on_user(messages: list[Message]) -> list[list[Message]]: | |||
turn_start_indices: list[int] = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Food for thought here: should you add a check for an empty input? I think _split_message_list_on_user([])
should return []
not [ [] ]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right, updated!
src/oumi/core/types/conversation.py
Outdated
"""Gets all messages in the conversation, optionally filtered by role. | ||
|
||
Args: | ||
role: The role to filter messages by. | ||
If None, returns all messages. | ||
If None, no filtering by role is applied. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This implies that the filter_fn has to use to role
field, which isn't necessarily true.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added Optional to make it more clear
Description
-- Add flags to split multi-turn conversations into N single-turn conversations
-- Modify
Conversation.filter_messages()
method to accept user-defined predicate.Related issues
Towards OPE-355
Before submitting
Reviewers
At least one review from a member of
oumi-ai/oumi-staff
is required.