Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

huggingface_hub.utils._validators.HFValidationError: Repo id must use alphanumeric chars or '-', '_', '.', '--' and '..' are forbidden, '-' and '.' cannot start or end the name, max length is 96: ''. #687

Open
WildLight opened this issue Apr 9, 2024 · 0 comments

Comments

@WildLight
Copy link

hi, I meet the error following:

Traceback (most recent call last):
  File "blip2_instructed_generation.py", line 30, in <module>
    model, vis_processors, _ = load_model_and_preprocess(
  File "/public/xx/tvqa_test/LAVIS-main/lavis/models/__init__.py", line 205, in load_model_and_preprocess
    model = model_cls.from_pretrained(model_type=model_type)
  File "/public/xx/tvqa_test/LAVIS-main/lavis/models/base_model.py", line 70, in from_pretrained
    model = cls.from_config(model_cfg)
  File "/public/xx/tvqa_test/LAVIS-main/lavis/models/blip2_models/blip2_vicuna_instruct.py", line 715, in from_config
    model = cls(
  File "/public/xx/tvqa_test/LAVIS-main/lavis/models/blip2_models/blip2_vicuna_instruct.py", line 90, in __init__
    self.llm_tokenizer = LlamaTokenizer.from_pretrained(llm_model, use_fast=False, truncation_side="left")
  File "/root/anaconda/envs/instructblip/lib/python3.8/site-packages/transformers/tokenization_utils_base.py", line 1813, in from_pretrained
    resolved_vocab_files[file_id] = cached_file(
  File "/root/anaconda/envs/instructblip/lib/python3.8/site-packages/transformers/utils/hub.py", line 429, in cached_file
    resolved_file = hf_hub_download(
  File "/root/anaconda/envs/instructblip/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 111, in _inner_fn
    validate_repo_id(arg_value)
  File "/root/anaconda/envs/instructblip/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 165, in validate_repo_id
    raise HFValidationError(
huggingface_hub.utils._validators.HFValidationError: Repo id must use alphanumeric chars or '-', '_', '.', '--' and '..' are forbidden, '-' and '.' cannot start or end the name, max length is 96: ''.

I use the code following from here: https://github.com/salesforce/LAVIS/tree/main/projects/instructblip

import torch
from PIL import Image
# setup device to use
device = torch.device("cuda") if torch.cuda.is_available() else "cpu"
# load sample image
raw_image = Image.open("../../docs/_static/Confusing-Pictures.jpg").convert("RGB")
display(raw_image.resize((596, 437)))
from lavis.models import load_model_and_preprocess
# loads InstructBLIP model
model, vis_processors, _ = load_model_and_preprocess(name="blip2_vicuna_instruct", model_type="vicuna7b", is_eval=True, device=device)
# prepare the image
image = vis_processors["eval"](raw_image).unsqueeze(0).to(device)

the version of me conda following:

torch                     2.0.1
salesforce-lavis          1.0.1
transformers              4.33.2

so how can I solve it? please help me, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant