From 2a73943e7da3824e6100ddd5b81498d85e42e377 Mon Sep 17 00:00:00 2001 From: Yoav Katz Date: Sun, 18 Jan 2026 11:55:35 +0200 Subject: [PATCH 1/2] Fix data classification policy warning in qa_evaluation.py - Add explicit data_classification_policy=['public'] parameter to create_dataset() - Removes warning: 'LoadFromDictionary sets data_classification_policy to [proprietary] by default' Signed-off-by: Yoav Katz --- examples/qa_evaluation.py | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/qa_evaluation.py b/examples/qa_evaluation.py index fd456e59d2..1bd707375b 100644 --- a/examples/qa_evaluation.py +++ b/examples/qa_evaluation.py @@ -26,6 +26,7 @@ template="templates.qa.open", split="test", format="formats.chat_api", + data_classification_policy=["public"], ) model = CrossProviderInferenceEngine(model="SmolLM2-1.7B-Instruct", provider="hf-local") From 3d3b21d68179fd09defa82620c2f16ce200603db Mon Sep 17 00:00:00 2001 From: Yoav Katz Date: Sun, 18 Jan 2026 11:55:45 +0200 Subject: [PATCH 2/2] Replace deprecated torch_dtype with dtype parameter - Update all from_pretrained() calls to use 'dtype' instead of 'torch_dtype' - Fixes deprecation warning from transformers library - Changes in HFPipelineBasedInferenceEngine, LlavaInferenceEngine, and HFPeftInferenceEngine Signed-off-by: Yoav Katz --- src/unitxt/inference.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/unitxt/inference.py b/src/unitxt/inference.py index 2b05ff4a6b..68bbeba898 100644 --- a/src/unitxt/inference.py +++ b/src/unitxt/inference.py @@ -728,9 +728,9 @@ def _get_model_args(self) -> Dict[str, Any]: args["quantization_config"] = quantization_config elif self.use_fp16: if self.device == torch.device("mps"): - args["torch_dtype"] = torch.float16 + args["dtype"] = torch.float16 else: - args["torch_dtype"] = torch.bfloat16 + args["dtype"] = torch.bfloat16 # We do this, because in some cases, using device:auto will offload some weights to the cpu # (even though the model might *just* fit to a single gpu), even if there is a gpu available, and this will @@ -937,7 +937,7 @@ def _init_model(self): self.model = LlavaForConditionalGeneration.from_pretrained( self.model_name, - torch_dtype=self._get_torch_dtype(), + dtype=self._get_torch_dtype(), low_cpu_mem_usage=self.low_cpu_mem_usage, device_map=self.device_map, ) @@ -1108,7 +1108,7 @@ def _init_model(self): trust_remote_code=True, device_map=self.device_map, low_cpu_mem_usage=self.low_cpu_mem_usage, - torch_dtype=self._get_torch_dtype(), + dtype=self._get_torch_dtype(), ) self.model = self.model.to( dtype=self._get_torch_dtype() @@ -1197,9 +1197,9 @@ def _get_model_args(self) -> Dict[str, Any]: args["quantization_config"] = quantization_config elif self.use_fp16: if self.device == torch.device("mps"): - args["torch_dtype"] = torch.float16 + args["dtype"] = torch.float16 else: - args["torch_dtype"] = torch.bfloat16 + args["dtype"] = torch.bfloat16 # We do this, because in some cases, using device:auto will offload some weights to the cpu # (even though the model might *just* fit to a single gpu), even if there is a gpu available, and this will