langtest.modelhandler.custom_modelhandler.PretrainedModelForQA#
- class PretrainedModelForQA(model: Any)#
Bases:
PretrainedCustomModel,ModelAPIA class for handling a pre-trained model for question answering.
Inherits from PretrainedCustomModel and ModelAPI.
- predict(text: str, \*args, \*\*kwargs)#
Predicts the answer to a given question based on the pre-trained model.
- Raises:
Exception – If an error occurs during prediction.
Methods
__init__(model)load_model(path)Load the model.
predict(text, *args, **kwargs)Perform predictions on input text.
predict_raw(text, *args, **kwargs)Attributes
model_registry- classmethod load_model(path: Any) Any#
Load the model.
- predict(text: str, *args, **kwargs)#
Perform predictions on input text.