Vision-CAIR / MiniGPT-4

Open-sourced codes for MiniGPT-4 and MiniGPT-v2 (https://minigpt-4.github.io, https://minigpt-v2.github.io/)
https://minigpt-4.github.io
BSD 3-Clause "New" or "Revised" License
25.4k stars 2.91k forks source link

run demo.py reporting Error #333

Open duguwanglong opened 1 year ago

duguwanglong commented 1 year ago

RuntimeError: Internal: src/sentencepiece_processor.cc(890) [model_proto->ParseFromArray(serialized.data(), serialized.size())]

self.llama_tokenizer = LlamaTokenizer.from_pretrained

ibrahus commented 1 year ago

I'm getting the below error when running the demo on Colab with Llama 2 Chat 7B:

2023-08-30 16:34:33.592467: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
Initializing Chat
Loading VIT
Loading VIT Done
Do not use Q-Former here.
Loading LLAMA
/usr/local/lib/python3.10/dist-packages/transformers/tokenization_utils_base.py:1756: FutureWarning: Calling LlamaTokenizer.from_pretrained() with the path to a single file or url is deprecated and won't be possible anymore in v5. Use a model identifier or the path to a directory instead.
  warnings.warn(
Traceback (most recent call last):
  File "/content/MiniGPT-4/demo.py", line 63, in <module>
    model = model_cls.from_config(model_config).to('cuda:{}'.format(args.gpu_id))
  File "/content/MiniGPT-4/minigpt4/models/mini_gpt4.py", line 356, in from_config
    model = cls(
  File "/content/MiniGPT-4/minigpt4/models/mini_gpt4.py", line 107, in __init__
    self.llama_tokenizer = LlamaTokenizer.from_pretrained(llama_model, use_fast=False, legacy=False)
  File "/usr/local/lib/python3.10/dist-packages/transformers/tokenization_utils_base.py", line 1854, in from_pretrained
    return cls._from_pretrained(
  File "/usr/local/lib/python3.10/dist-packages/transformers/tokenization_utils_base.py", line 2017, in _from_pretrained
    tokenizer = cls(*init_inputs, **init_kwargs)
  File "/usr/local/lib/python3.10/dist-packages/transformers/models/llama/tokenization_llama.py", line 156, in __init__
    self.sp_model = self.get_spm_processor()
  File "/usr/local/lib/python3.10/dist-packages/transformers/models/llama/tokenization_llama.py", line 165, in get_spm_processor
    model = model_pb2.ModelProto.FromString(sp_model)
google.protobuf.message.DecodeError: Error parsing message with type 'sentencepiece.ModelProto'