def convert_by_vocab(self, vocab, items):
        """Converts a sequence of [tokens|ids] using the vocab."""
        output = []
        for item in items:
            output.append(vocab[item])
        return output
Converts a sequence of [tokens|ids] using the vocab.
mmpretrain/models/utils/tokenizer.py