I found that you can get the indew of a word in gensim’s word2vec like this:
import gensim
from torch import nn

model = gensim.models.KeyedVectors.load_word2vec_format('path/to/file')
# weights to use in from_pretrained()
weights = torch.FloatTensor(model.vectors)
# getting index from word
model.vocab['banana'].index