Given a merge list, implement a BPE tokenizer for a string

Tokenization and Embeddings1 / 4

Chapter 021 / 4

Tokenization and Embeddings

Given a merge list, implement a BPE tokenizer for a string

Easy
Target interface
bpe_encode(text, merges)

Complete the starter code in the editor. Any correct approach is accepted.

Hints0 / 2
Reference solution
Your own code stays in the editor.