Home › Forums › Domine LLMs com LangChain › Erro quantization_config
- This topic has 1 reply, 2 voices, and was last updated 7 months, 1 week ago by Gabriel Alves. 
- AuthorPosts
- 20 de março de 2025 at 10:27 #48786Bom dia! Estou com esse erro ————————————————————————— ImportError Traceback (most recent call last) <ipython-input-43-cf2e06e40223> in <cell line: 0>() 
 1 model_id = “meta-llama/Meta-Llama-3-8B-Instruct”
 —-> 2 model = AutoModelForCausalLM.from_pretrained(model_id, quantization_config=quantization_config)
 3 tokenizer = AutoTokenizer.from_pretrained(model_id)2 frames 
 /usr/local/lib/python3.11/dist-packages/transformers/quantizers/quantizer_bnb_4bit.py in validate_environment(self, *args, **kwargs)
 73 )
 74 if not is_bitsandbytes_available():
 —> 75 raise ImportError(
 76 “Usingbitsandbytes4-bit quantization requires the latest version of bitsandbytes:pip install -U bitsandbytes”
 77 )ImportError: Using bitsandbytes4-bit quantization requires the latest version of bitsandbytes:pip install -U bitsandbytes21 de março de 2025 at 02:00 #48794Olá Celso! Pode ser um bug da biblioteca no Colab, testei agora o código com a versão mais recente e funcionou corretamente. Testei o mesmo código da seção (link aqui) Tente desinstalar o bitsandbytes e instalar novamente de outro modo, segue o comando abaixo: !pip uninstall bitsandbytes !python -m pip install bitsandbytes --prefer-binary --extra-index-url=https://jllllll.github.io/bitsandbytes-windows-webui E reinicie a sessão do Colab logo após executar o comando (provavelmente ele vai pedir automaticamente, daí basta clicar no botão que aparecer na tela para reiniciar) Caso não funcione, outro comando que costuma resolver é esse: !pip install bitsandbytes-cuda110 bitsandbytes (execute bem no começo do Colab e reinicie a sessão antes) Teste e me avise se não funcionar 
- AuthorPosts
- You must be logged in to reply to this topic.