It’s calling the tokenize_pairs function correctly. You’re close.
There’s just one little conversion missing.
  File "/Users/cong/.venv/tf2/lib/python3.8/site-packages/transformers/tokenization_utils.py", line 336, in split_on_tokens
    if not text.strip():

AttributeError: 'numpy.ndarray' object has no attribute 'strip'

The function is getting called with a numpy array as input, but it looks like it’s expecting an actual python string.
Right now you’re running map after batch:
      .batch(BATCH_SIZE)
      .map(py_wrap_tokenize_pairs,...)

So your tokenize_pairs function is getting batches of strings as a numpy array.
You either need to loop over the array and unpack the strings, or, map-then-batch so you get scalar arrays and you can unpack those.
It looks like str(a)  is how you unpack a scalar string from a numpy array.