Loading Weights for GloVe Model

I am trying to load the weights from the GloVe file that I have downloaded and I am confused on some details. There is one example of loading a glove model on the debugger cafe website that has the line

self.linear1 = nn.Linear(embed_dim, num_classes)

The embed_dim variable make sense but I am not sure about the num_classes variable. The example that this is pulled from has 7 classes because it is trying to classify emotions. However, since I am not classifying emotions would that mean I use the number of words in the GloVe in this case 400000? or am I wrong in using a linear layer all together and I am actually supposed to use a sparse layer like nn.Embedding?

So I have an update to the problem. I tried a linear layer and used that in my code and it errored with the message: “The model was not an embedding” so it seems like I need to use the Embedding sparse layer. Now my issue seems to be tracing this model because I am getting the error:

RuntimeError: Expected tensor for argument #1 ‘indices’ to have one of the following scalar types: Long, Int; but got torch.FloatTensor instead (while checking arguments for embedding)

I was successful in tracing the linear model with the line
traced_model = torch.jit.trace(embedding_model, torch.rand(50))
but that doesn’t seem to be the case with this embedding layer