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

Ordering of output in sentiment_pipe function #117

Closed
kaushalshetty opened this issue Jan 27, 2023 · 2 comments
Closed

Ordering of output in sentiment_pipe function #117

kaushalshetty opened this issue Jan 27, 2023 · 2 comments

Comments

@kaushalshetty
Copy link

In the notebook gpt2-sentiment-control.ipynb (Optimize model section) ,
logits = [torch.tensor(output[1]["score"]) for output in sentiment_pipe(texts, **sentiment_pipe_kwargs)]

Why do we store output[1]["score"] as the reward? I assumed that "We will use the logits for positive class as a reward signal for the language model." but does sentiment_pipe always has the output[1] as an index for the the positive class?

@lvwerra
Copy link
Member

lvwerra commented Jan 30, 2023

I just checked and you are right, this is not always the case! I will fix the example. cc @younesbelkada maybe this explains the spikes.

@lvwerra
Copy link
Member

lvwerra commented Feb 7, 2023

This should be fixed with #126.

@lvwerra lvwerra closed this as completed Feb 7, 2023
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

2 participants