pythonmachine-learninghuggingface-transformershuggingfacebloom

Can't use BloomAI locally


So I just finished installing Bloom's model from Huggingface & I tried to run it in my notebook.

Here's the code:

from transformers import AutoTokenizer, AutoModel
model_path = "D:/bloom"
tokenizer = AutoTokenizer.from_pretrained(model_path)
model = AutoModel.from_pretrained(model_path)

and I get this error:

DefaultCPUAllocator: not enough memory: you tried to allocate xxx bytes

So then I went on to google searching and found this article:

https://towardsdatascience.com/run-bloom-the-largest-open-access-ai-model-on-your-desktop-computer-f48e1e2a9a32

However, I get this error:

TypeError: build_alibi_tensor() missing 1 required positional argument: 'device'

How to run Bloom locally?


Solution

  • I had that problem (and others beyond it) because I was using a more recent version of the transformers library than the one used in the article you linked. Try using transformers version 4.20.0 as the article mentions.