NameError: name 'inference' is not defined

after model was trained and loaded back to the notebook, i am trying to process the results on the test data :
test_question = test_dataset[0][‘question’]

print(“Question input (test):”, test_question)

print("Finetuned slightly model’s answer: ")

print(inference(test_question, finetuned_slightly_model, tokenizer))

i get an error :

Finetuned slightly model's answer: `---------------------------------------------------------------------------
NameError Traceback (most recent call last)
Cell In[80], line 5
2 print(“Question input (test):”, test_question)
4 print("Finetuned slightly model’s answer: ")
----> 5 print(inference(test_question, finetuned_slightly_model, tokenizer))

NameError: name ‘inference’ is not defined`

Make sure you are running all the previous cells where the inference functions is defined!