Solved by J_Johnson in post #3 
              
              
                This seems to be a decent workaround: 


def save_vocab(vocab, path):
    with open(path, 'w+', encoding='utf-8') as f:     
        for token, index in vocab.stoi.items():
            f.write(f'{index}\t{token}\n')

Then : 
def read_vocab(path):
    vocab = dict()
    with open(path, 'r', encoding=…