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

[SFTTrainer] Support logging response in wandb #851

Closed
wants to merge 1 commit into from

Conversation

vwxyzjn
Copy link
Contributor

@vwxyzjn vwxyzjn commented Oct 10, 2023

What does this PR do?

This PR attempts to log some sample and reference responses in wandb, which gives concrete examples for our inspection and also makes training more informative. Basically, it's going to log something as follows:

image

Some datasets such as timdettmers/openassistant-guanaco do not really have a query/response structure, so I basically give the model the first half of the token in the dataset and let it generate the remaining tokens; I also added the second half of the token as the reference response to test out the SFT policy.

Question:

I wasn't quite sure how to get the batching working with dataset and generate, though... The dataloader complains

ValueError: Unable to create tensor, you should probably activate truncation and/or padding with 'padding=True' 'truncation=True' to have batched tensors with the same length. Perhaps your features (`remaining_input_ids` in this case) have excessive nesting (inputs type `list` where type `int` is expected).

if I try to use a batch_size > 1 for the dataloader.

@vwxyzjn vwxyzjn requested a review from lewtun October 10, 2023 17:47
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

Copy link

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

@github-actions github-actions bot closed this Nov 19, 2023
@vwxyzjn vwxyzjn reopened this Nov 20, 2023
@github-actions github-actions bot closed this Nov 28, 2023
@lvwerra lvwerra reopened this Nov 29, 2023
@vwxyzjn
Copy link
Contributor Author

vwxyzjn commented Dec 1, 2023

update: after chatting with @lvwerra, we think maybe the change in SFTTrainer is unnecessary. Will checkout how can we further improve it.

Copy link

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

@github-actions github-actions bot closed this Jan 3, 2024
@JamesSand
Copy link

Hi, I have met the same problem. Does anyone solve that?

I have tried to use the demo code provided in the readme, but it still does not work....

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

Successfully merging this pull request may close these issues.

4 participants