From e1a77d3710c78949abc6218ee30299392d57d271 Mon Sep 17 00:00:00 2001 From: Nanbo Liu Date: Wed, 27 Sep 2023 18:13:47 +0000 Subject: [PATCH] added model_kwargs --- runtimes/huggingface/mlserver_huggingface/common.py | 1 + runtimes/huggingface/mlserver_huggingface/settings.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/runtimes/huggingface/mlserver_huggingface/common.py b/runtimes/huggingface/mlserver_huggingface/common.py index 53b9d10f2..c32b5fb99 100644 --- a/runtimes/huggingface/mlserver_huggingface/common.py +++ b/runtimes/huggingface/mlserver_huggingface/common.py @@ -54,6 +54,7 @@ def load_pipeline_from_settings( hf_pipeline = pipeline( hf_settings.task_name, model=model, + model_kwargs=hf_settings.model_kwargs, tokenizer=tokenizer, device=hf_settings.device, batch_size=batch_size, diff --git a/runtimes/huggingface/mlserver_huggingface/settings.py b/runtimes/huggingface/mlserver_huggingface/settings.py index b6bc11b5d..b461080f3 100644 --- a/runtimes/huggingface/mlserver_huggingface/settings.py +++ b/runtimes/huggingface/mlserver_huggingface/settings.py @@ -61,7 +61,10 @@ class Config: """ Name of the model that should be loaded in the pipeline. """ - + model_kwargs: Optional[dict] = None + """ + model kwargs that should be loaded in the pipeline. + """ pretrained_tokenizer: Optional[str] = None """ Name of the tokenizer that should be loaded in the pipeline.