MiniGPT-4 icon indicating copy to clipboard operation
MiniGPT-4 copied to clipboard

huggingface_hub.utils._validators.HFValidationError: Repo id must be in the form 'repo_name' or 'namespace/repo_name'

Open masapasa opened this issue 3 years ago • 6 comments

python demo.py --cfg-path eval_configs/minigpt4_eval.yaml Initializing Chat Loading VIT Loading VIT Done Loading Q-Former Loading Q-Former Done Loading LLAMA Traceback (most recent call last): File "/home/Startupcolors/doze/wound/MiniGPT-4/demo.py", line 57, in model = model_cls.from_config(model_config).to('cuda:0') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/Startupcolors/doze/wound/MiniGPT-4/minigpt4/models/mini_gpt4.py", line 241, in from_config model = cls( ^^^^ File "/home/Startupcolors/doze/wound/MiniGPT-4/minigpt4/models/mini_gpt4.py", line 85, in init self.llama_tokenizer = LlamaTokenizer.from_pretrained(llama_model, use_fast=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/Startupcolors/miniconda3/envs/fit/lib/python3.11/site-packages/transformers/tokenization_utils_base.py", line 1770, in from_pretrained resolved_vocab_files[file_id] = cached_file( ^^^^^^^^^^^^ File "/home/Startupcolors/miniconda3/envs/fit/lib/python3.11/site-packages/transformers/utils/hub.py", line 409, in cached_file resolved_file = hf_hub_download( ^^^^^^^^^^^^^^^^ File "/home/Startupcolors/miniconda3/envs/fit/lib/python3.11/site-packages/huggingface_hub/utils/_validators.py", line 112, in _inner_fn validate_repo_id(arg_value) File "/home/Startupcolors/miniconda3/envs/fit/lib/python3.11/site-packages/huggingface_hub/utils/_validators.py", line 160, in validate_repo_id raise HFValidationError( huggingface_hub.utils._validators.HFValidationError: Repo id must be in the form 'repo_name' or 'namespace/repo_name': '/path/to/vicuna/weights/'. Use repo_type argument if needed.

masapasa avatar Apr 20 '23 10:04 masapasa

I'm also having the same problem. It is somehow related to this step:

  1. Prepare the pretrained MiniGPT-4 checkpoint To play with our pretrained model, download the pretrained checkpoint here. Then, set the path to the pretrained checkpoint in the evaluation config file in eval_configs/minigpt4_eval.yaml at Line 11.

The path at line 11 is interpreted as a repo id rather than a relative local path

elvisnava avatar Apr 20 '23 13:04 elvisnava

Ok, I fixed this. So, apparently, you have to use an absolute path to your the vicuna checkpoint (starting with "/"), otherwise it gets interpreted as a hosted huggingface model.

elvisnava avatar Apr 20 '23 13:04 elvisnava

Thanks, me too, but I am getting this error Initializing Chat Loading VIT Loading VIT Done Loading Q-Former Loading Q-Former Done Loading LLAMA /home/Startupcolors/miniconda3/envs/fit/lib/python3.11/site-packages/transformers/tokenization_utils_base.py:1714: 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) ──────────────────────╮ │ /home/Startupcolors/doze/wound/MiniGPT-4/demo.py:57 in │ │ │ │ 54 │ │ 55 model_config = cfg.model_cfg │ │ 56 model_cls = registry.get_model_class(model_config.arch) │ │ ❱ 57 model = model_cls.from_config(model_config).to('cuda:0') │ │ 58 │ │ 59 vis_processor_cfg = cfg.datasets_cfg.cc_sbu_align.vis_processor.train │ │ 60 vis_processor = registry.get_processor_class(vis_processor_cfg.name).f │ │ │ │ /home/Startupcolors/doze/wound/MiniGPT-4/minigpt4/models/mini_gpt4.py:241 in │ │ from_config │ │ │ ... │ 313 │ │ return _sentencepiece.SentencePieceProcessor__EncodeAsIds(sel │ ╰──────────────────────────────────────────────────────────────────────────────╯ RuntimeError: Internal: src/sentencepiece_processor.cc(1101) [model_proto->ParseFromArray(serialized.data(), serialized.size())]

masapasa avatar Apr 20 '23 14:04 masapasa

Ok, I fixed this. So, apparently, you have to use an absolute path to your the vicuna checkpoint (starting with "/"), otherwise it gets interpreted as a hosted huggingface model.

Hello, I got the same error, could you please explain how to modify it specifically, thx.

Sir1usss avatar Apr 21 '23 09:04 Sir1usss

i got the same error, I've even added vicuna checkpoint (starting with "/")

Lanceliyp avatar Apr 24 '23 02:04 Lanceliyp

我也遇到了同样的错误

917940234 avatar Apr 24 '23 12:04 917940234

q

salmaelgayar avatar Aug 07 '23 10:08 salmaelgayar

any help ??

salmaelgayar avatar Aug 07 '23 10:08 salmaelgayar