hugging_face_serving package#

Submodules#

hugging_face_serving.hugging_face_serving module#

class hugging_face_serving.hugging_face_serving.HuggingFaceModelServer(context: MLClientCtx, name: str, task: str, model_path: str | None = None, model_name: str | None = None, model_class: str | None = None, tokenizer_name: str | None = None, tokenizer_class: str | None = None, framework: str | None = None, **class_args)[source]#

Bases: V2ModelServer, ABC

Hugging Face Model serving class, inheriting the V2ModelServer class for being initialized automatically by the model server and be able to run locally as part of a nuclio serverless function, or as part of a real-time pipeline.

load()[source]#

load and initialize the model and/or other elements

predict(body: dict) List[source]#

Generate model predictions from sample.

Module contents#