From a6f31a88f2cf4b968abc497773a058d2d2bc8a2c Mon Sep 17 00:00:00 2001 From: Kye Date: Fri, 25 Aug 2023 14:23:32 -0400 Subject: [PATCH] clean up Former-commit-id: 0efe77183a79a9fdb2310a519854932e4fef0191 --- example.py | 2 +- swarms/agents/models/huggingface.py | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/example.py b/example.py index c27e7293..8a5a8a18 100644 --- a/example.py +++ b/example.py @@ -2,7 +2,7 @@ from swarms import Worker node = Worker( - openai_api_key="", + openai_api_key="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", ai_name="Optimus Prime", ) diff --git a/swarms/agents/models/huggingface.py b/swarms/agents/models/huggingface.py index 54182738..f4681a8e 100644 --- a/swarms/agents/models/huggingface.py +++ b/swarms/agents/models/huggingface.py @@ -1,6 +1,6 @@ import torch import logging -from transformers import BitsAndBytesConfig +# from transformers import BitsAndBytesConfig from transformers import AutoModelForCausalLM, AutoTokenizer @@ -11,16 +11,16 @@ class HuggingFaceLLM: self.model_id = model_id self.max_length = max_length - bnb_config = None - if quantize: - if not quantization_config: - quantization_config = { - 'load_in_4bit': True, - 'bnb_4bit_use_double_quant': True, - 'bnb_4bit_quant_type': "nf4", - 'bnb_4bit_compute_dtype': torch.bfloat16 - } - bnb_config = BitsAndBytesConfig(**quantization_config) + # bnb_config = None + # if quantize: + # if not quantization_config: + # quantization_config = { + # 'load_in_4bit': True, + # 'bnb_4bit_use_double_quant': True, + # 'bnb_4bit_quant_type': "nf4", + # 'bnb_4bit_compute_dtype': torch.bfloat16 + # } + # bnb_config = BitsAndBytesConfig(**quantization_config) try: self.tokenizer = AutoTokenizer.from_pretrained(self.model_id)