Fails to load local version: FileNotFoundError: ~/.cache/huggingface/modules/transformers_modules/rope.py

#69
by treehugg3 - opened

I am running via

from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained(
    "./moondream2",
    trust_remote_code=True,
)

and get:

...
  File "/venv/lib/python3.10/site-packages/transformers/dynamic_module_utils.py", line 128, in get_relative_import_files
    new_imports.extend(get_relative_imports(f))
  File "/venv/lib/python3.10/site-packages/transformers/dynamic_module_utils.py", line 97, in get_relative_imports
    with open(module_file, "r", encoding="utf-8") as f:
FileNotFoundError: [Errno 2] No such file or directory: '/home/april/.cache/huggingface/modules/transformers_modules/rope.py'

This is basically the same as https://github.com/vikhyat/moondream/issues/256

I am also at my "wit's end"

I got past it by manually copying the files (needed rope.py and also layers.py) from this repo to the location it asked for. But... why is moondream trashing this huggingface directory?

This sounds like a transformers bug... we have it contained in a self-contained executable that should work out of the box here: https://moondream.ai/c/moondream-server

did you solve this? i have same problem.

Your need to confirm your account before you can post a new comment.

Sign up or log in to comment