From 78b1e83c3fc6762aa1253b8b8bf4508e698741ed Mon Sep 17 00:00:00 2001 From: AlexanderLavelle <73360008+AlexanderLavelle@users.noreply.github.com> Date: Wed, 24 Apr 2024 19:56:11 -0400 Subject: [PATCH] quantized models don't have .to ValueError: `.to` is not supported for `4-bit` or `8-bit` bitsandbytes models. Please use the model as it is, since the model has already been set to the correct devices and casted to the correct `dtype`. --- swarms/models/huggingface.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swarms/models/huggingface.py b/swarms/models/huggingface.py index e459b251..993aa8cf 100644 --- a/swarms/models/huggingface.py +++ b/swarms/models/huggingface.py @@ -181,7 +181,7 @@ class HuggingfaceLLM(AbstractLLM): quantization_config=bnb_config, *args, **kwargs, - ).to(self.device) + ) else: self.model = AutoModelForCausalLM.from_pretrained( self.model_id, *args, **kwargs