h2oai / h2ogpt

Private chat with local GPT with document, images, video, etc. 100% private, Apache 2.0. Supports oLLaMa, Mixtral, llama.cpp, and more. Demo: https://gpt.h2o.ai/ https://codellama.h2o.ai/
http://h2o.ai
Apache License 2.0
10.94k stars 1.2k forks source link

Traceback: 'NoneType' object is not iterable (gen.py, line 2435) #1690

Closed bibo7086 closed 2 weeks ago

bibo7086 commented 2 weeks ago

The script generate.py encountered an error during execution. The error originates from line 2435 within the file gen.py. Here's the exact error message:

Traceback (most recent call last):
  File "/path/to/development/h2ogpt/generate.py", line 20, in <module>
    entrypoint_main()
  File "/path/to/development/h2ogpt/generate.py", line 16, in entrypoint_main
    H2O_Fire(main)
  File "/path/to/development/h2ogpt/src/utils.py", line 75, in H2O_Fire
    fire.Fire(component=component, command=args)
  File "/path/to/miniconda3/lib/python3.10/site-packages/fire/core.py", line 143, in Fire
    component_trace = _Fire(component, args, parsed_flag_args, context, name)
  File "/path/to/miniconda3/lib/python3.10/site-packages/fire/core.py", line 477, in _Fire
    component, remaining_args = _CallAndUpdateTrace(
  File "/path/to/miniconda3/lib/python3.10/site-packages/fire/core.py", line 693, in _CallAndUpdateTrace
    component = fn(*varargs, **kwargs)
  File "/path/to/development/h2ogpt/src/gen.py", line 2435, in main
    all_visible_models = [x.get('visible_models') or x.get('base_model') for x in model_lock]
TypeError: 'NoneType' object is not iterable

Steps to Reproduce:

  1. Run the following command:
python generate.py --base_model=TheBloke/Mistral-7B-Instruct-v0.2-GGUF --prompt_type=mistral --max_seq_len=4096

Note: Running without the base model option works fine, i.e.

python generate.py --prompt_type=mistral --model_path_llama=https://huggingface.co/TheBloke/Mistral-7B-Instruct-v0.2-GGUF/resolve/main/mistral-7b-instruct-v0.2.Q5_K_M.gguf --share=False
pseudotensor commented 2 weeks ago

Hi, it was fixed