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

include the output layer in the model using the pretrained weights #18

Closed
wants to merge 1 commit into from

Conversation

fabiopetroni
Copy link

This is to be able to load the final output layer (bert.output_layer) from the TensorFlow pre-trained model.
In particular, it is a fully connected layer that is used to map the final hidden layer to the vocabulary size, to then apply the softmax, as follows:

logits = bert.output_layer(sequence_output)
log_softmax = nn.LogSoftmax(dim=-1)
log_probs = log_softmax(logits)

@thomwolf
Copy link
Member

Thanks for that. I've ended up taking a more modular approach in the first pip release of the library.

@thomwolf thomwolf closed this Nov 17, 2018
@HongyanJiao HongyanJiao mentioned this pull request Sep 19, 2019
stevezheng23 added a commit to stevezheng23/transformers that referenced this pull request Mar 24, 2020
fix at issues in roberta/berta modeling (cont.)
wamartin-aml pushed a commit to wamartin-aml/transformers that referenced this pull request Nov 1, 2021
…ortmodule

Permit DDP wrapping for ORTModule
rraminen pushed a commit to rraminen/transformers that referenced this pull request Oct 27, 2022
…t_HF

Enable ORT for HuggingFace workloads
jlamypoirier added a commit to jlamypoirier/transformers that referenced this pull request Apr 4, 2023
jameshennessytempus pushed a commit to jameshennessytempus/transformers that referenced this pull request Jun 1, 2023
jonb377 pushed a commit to jonb377/hf-transformers that referenced this pull request Nov 3, 2023
Summary:
This pull requests fix a bug in pytorch-tpu#17 where it forgot to guard 2D sharding for activations and inputs.

Test Plan:
N/A.
amyeroberts pushed a commit that referenced this pull request Apr 15, 2024
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.

2 participants