def predict_fn()

in sagemaker_notebook_instance/containers/question_answering/entry_point.py [0:0]


def predict_fn(request_body, model_assets):
    question = request_body["question"]
    context = request_body["context"]
    answerer = model_assets['answerer']
    answers = answerer(
        question=question,
        context=context,
        topk=get_parameter(request_body, 'topk', 3)
    )
    return {"answers": answers}