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

Support masking of partial dialogue in multi-turn chat datasets #2207

Open
jiatong-yu opened this issue Dec 25, 2024 · 2 comments
Open

Support masking of partial dialogue in multi-turn chat datasets #2207

jiatong-yu opened this issue Dec 25, 2024 · 2 comments

Comments

@jiatong-yu
Copy link

According to the documentation, it appears that Torchtune currently supports training using either all “assistant” | “user” content or all of “assistant” content in a multi-turn conversation. However, a common use case is training on a specific subset of responses, such as only the most recent “assistant” responses in a conversation.

What is the recommended approach for achieving this with Torchtune?

@felipemello1
Copy link
Contributor

felipemello1 commented Dec 26, 2024

hey @jiatong-yu , you should be able to write your own custom message_transform / dataset.

Here is our wiki: https://pytorch.org/torchtune/main/basics/message_transforms.html

Take a look at how its done in the chat dataset: chatdataset.

train_on_input: bool = False,

Then, in your config, you can pass:

tune run <recipe> <config> --config dataset._component_:path.to.my.custom.dataset

@calvinpelletier
Copy link
Contributor

Here's some additional info: #2111 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants