

prepare table + question
data = {"Actors": ["Brad Pitt", "Leonardo Di Caprio", "George Clooney"], "Number of movies": ["87", "53", "69"]}
table = pd.DataFrame.from_dict(data)
questions = [
     "how many movies does Leonardo Di Caprio have?",
     "which actor has 69 movies?",
     "what's the first name of the actor who has 87 movies?",
 ]
encoding = tokenizer(table, questions, padding=True, return_tensors="pt")
let the model generate an answer autoregressively
outputs = model.generate(**encoding)
decode back to text
tokenizer.batch_decode(outputs, skip_special_tokens=True)
[' 53', ' george clooney', ' brad pitt']