1

I need to to run a series of pre-trained fine-tuned models from Hugging Face to Jupyter notebook. I have updated to the latest version of both PyTorch and Transformers, but when I run the code

from transformers import pipeline
pipe = pipeline("text-generation", model="abeja/ABEJA-QwQ32b-Reasoning-Japanese-v1.0")
messages = [
    {"role": "user", "content": "Who are you?"},
]
pipe(messages) 

Instead of transformers loading the model I get a long error message ending in:

"ModuleNotFoundError: Could not import module 'pipeline'. Are this object's requirements defined correctly?"

I have tried uninstalling and re-installing PyTorch and Transformers, and running the command as from transformers import AutoTokenizer, AutoModelForCausalLM instead, but nothing's worked so far. The kernel path is currently /Users/Library/Jupyter/kernels/python3. The only other thing that I can think of as significant is it's being run off a Mac Mini M4...I can't see how the hardware would be an issue but have heard people say there can be problems running LLMs on a Mac Mini...

4
  • 2
    Please can you paste the full error message? Commented Nov 4 at 11:37
  • maybe you have file trasformers.py or folder transformers and it tries to load from this file/folder instead of module transformers. Commented Nov 4 at 14:34
  • 1
    this type of error may suggests that you run import pipeline instead of from transformers import pipeline Commented Nov 4 at 14:37
  • Have you tried running this code in an isolated environment in vanilla python? I would recommend creating e.g. a virtualenv then activating it, then installing your requirements from a requirements.txt file (and sharing it with us) and then reporting the error you get from that. (or if not we can debug you jupyter setup) Commented Nov 5 at 17:50

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.