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

pytorch engine add get_logits #2487

Merged
merged 5 commits into from
Sep 24, 2024
Merged

Conversation

grimoire
Copy link
Collaborator

Model output hidden states instead of logits. Only last prefill logits would be computed.

@lvhan028 lvhan028 requested review from lvhan028 and removed request for irexyc September 23, 2024 07:48
tmp_out.pop('logits', None)
tmp_out['logits'] = logits_gather.get_logits()
tmp_out.pop('hidden_states', None)
tmp_out['hidden_states'] = logits_gather.get_logits()
Copy link
Collaborator

@RunningLeon RunningLeon Sep 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better rename _LogitsGather and some variable names since outputs are all hidden states before calling self.model_agent.get_logits(hidden_states). This would be more clear to understand.

Copy link
Collaborator

@RunningLeon RunningLeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lvhan028 lvhan028 merged commit 69844ae into InternLM:main Sep 24, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants