i think in chapter 6, Fast tokenizers in the QA pipeline (TensorFlow) , before
scores = np.triu(scores) , there should be import numpy as np .
and also i think finding the start and end indexes would be better with
index_stend = np.unravel_index(np.argmax(scores, axis=None), scores.shape)
start_index = max_index // scores.shape
end_index = max_index % scores.shape
Thanks for reporting! A fix is here: Add missing numpy import by lewtun · Pull Request #217 · huggingface/course · GitHub