FastChat icon indicating copy to clipboard operation
FastChat copied to clipboard

cannot import name 'find_layers' from 'modelutils'

Open bonesmoses opened this issue 1 year ago • 3 comments

Following the instructions to install:

pip3 install --upgrade pip
pip3 install -e .

And then running the model resulted in the following error:

Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/bones/build/FastChat/fastchat/serve/cli.py", line 162, in <module>
    main(args)
  File "/home/bones/build/FastChat/fastchat/serve/cli.py", line 99, in main
    from fastchat.serve.load_gptq_model import load_quantized
  File "/home/bones/build/FastChat/fastchat/serve/load_gptq_model.py", line 8, in <module>
    from modelutils import find_layers
ImportError: cannot import name 'find_layers' from 'modelutils' (/home/bones/.local/lib/python3.10/site-packages/modelutils/__init__.py)

After checking the latest release of modelutils, it does appear that there is no find_layers method implemented.

bonesmoses avatar Apr 12 '23 22:04 bonesmoses

Hi, Include this in the load_gptq_model.py "sys.path.append(*GPTQ-for-LLaMa)" find_layers are from modelutils.py is in GPTQ-for-LLaMa/modelutils.py

seungrokjung avatar Apr 13 '23 12:04 seungrokjung

That seems to do nothing. I placed the line right above this:

sys.path.insert(0, str(Path("repositories/GPTQ-for-LLaMa")))

I'll note that no GPTQ-for-LLaMa exists on my system anywhere. I even made sure to run updatedb so locate was fully up to date. Taking that as a hint, I went to the qwopqwop200/GPTQ-for-LLaMa repository and installed it separately. This seems to have fixed the issue, so perhaps the installation instructions here need a minor revision, or the dependencies should be updated.

Edit: Nope, that didn't do it either. I took the glacially long startup time as success. I'm stumped.

bonesmoses avatar Apr 13 '23 14:04 bonesmoses

Alright. so I'm dumb. I added the correct path to the repo. Though this is a somewhat unorthodox method.

sys.path.append("/home/bones/build/GPTQ-for-LLaMa")
sys.path.insert(0, str(Path("repositories/GPTQ-for-LLaMa")))

Still, the requirement for GPTQ-for-LLaMa isn't mentioned, and I had to clone and bootstrap it manually.

bonesmoses avatar Apr 13 '23 14:04 bonesmoses

CODE:- try: from modelutils import find_layers except ImportError: from utils import find_layers

ERROR:- from utils import find_layers ImportError: cannot import name 'find_layers' from 'utils'

PLEASE help me I'm not getting what is the problem, And i'm not getting any resources through out the whole internet

regnna avatar Apr 21 '23 21:04 regnna

i was trying to install oobabooga and vicuna in my cpu and im getting this error continously, what to do here

regnna avatar Apr 21 '23 22:04 regnna

Closing this is not related to any feature developed by this repo.

zhisbug avatar Apr 22 '23 02:04 zhisbug