shaopengw / Awesome-Music-Generation

Awesome music generation model——MG²
https://awesome-mmgen.github.io/
MIT License
115 stars 10 forks source link

huggingface_hub.errors.HFValidationError: Repo id must be in the form 'repo_name' or 'namespace/repo_name' #4

Closed nitinmukesh closed 2 weeks ago

nitinmukesh commented 2 weeks ago

What is the repo id? Currently it is hardcoded

self.tokenize = RobertaTokenizer.from_pretrained("/mnt/sda/upload_github/Awesome-Music-Generation/data/checkpoints/Roberta")

(venv) C:\aitools\Awesome-Music-Generation>quick_start.bat
SEED EVERYTHING TO 0
Seed set to 0
Add-ons: []
Dataset initialize finished
Reload ckpt specified in the config file data\checkpoints\mg2-diffusion-checkpoint.ckpt
LatentDiffusion: Running in eps-prediction mode
Traceback (most recent call last):
  File "C:\aitools\Awesome-Music-Generation\MMGen_train\infer.py", line 143, in <module>
    infer(dataset_json, config_yaml, config_yaml_path, exp_group_name, exp_name)
  File "C:\aitools\Awesome-Music-Generation\MMGen_train\infer.py", line 74, in infer
    latent_diffusion = instantiate_from_config(configs["model"])
  File "C:\aitools\Awesome-Music-Generation\MMGen_train\utilities\model_util.py", line 102, in instantiate_from_config
    return get_obj_from_str(config["target"])(**config.get("params", dict()))
  File "C:\aitools\Awesome-Music-Generation\MMGen_train\modules\latent_diffusion\ddpm.py", line 1018, in __init__
    super().__init__(conditioning_key=conditioning_key, *args, **kwargs)
  File "C:\aitools\Awesome-Music-Generation\MMGen_train\modules\latent_diffusion\ddpm.py", line 115, in __init__
    self.clap = CLAPAudioEmbeddingClassifierFreev2(
  File "C:\aitools\Awesome-Music-Generation\MMGen_train\conditional_models.py", line 1169, in __init__
    self.tokenize = RobertaTokenizer.from_pretrained("/mnt/sda/upload_github/Awesome-Music-Generation/data/checkpoints/Roberta")
  File "C:\aitools\Awesome-Music-Generation\venv\lib\site-packages\transformers\tokenization_utils_base.py", line 1784, in from_pretrained
    resolved_vocab_files[file_id] = cached_file(
  File "C:\aitools\Awesome-Music-Generation\venv\lib\site-packages\transformers\utils\hub.py", line 417, in cached_file
    resolved_file = hf_hub_download(
  File "C:\aitools\Awesome-Music-Generation\venv\lib\site-packages\huggingface_hub\utils\_deprecation.py", line 101, in inner_f
    return f(*args, **kwargs)
  File "C:\aitools\Awesome-Music-Generation\venv\lib\site-packages\huggingface_hub\utils\_validators.py", line 106, in _inner_fn
    validate_repo_id(arg_value)
  File "C:\aitools\Awesome-Music-Generation\venv\lib\site-packages\huggingface_hub\utils\_validators.py", line 154, in validate_repo_id
    raise HFValidationError(
huggingface_hub.errors.HFValidationError: Repo id must be in the form 'repo_name' or 'namespace/repo_name': '/mnt/sda/upload_github/Awesome-Music-Generation/data/checkpoints/Roberta'. Use `repo_type` argument if needed.
kily-wmz commented 2 weeks ago

Because I am loading roberta-base locally. For the first method, you can try changing self.tokenize = RobertaTokenizer.from_pretrained("/mnt/sda/upload_github/Awesome-Music-Generation/data/checkpoints/Roberta") to self.tokenize = RobertaTokenizer.from_pretrained("roberta-base"). For the second method, first download the model locally from https://huggingface.co/FacebookAI/roberta-base, and then replace .from_pretrainedwith your local download path.