fireicewolf / wd-llm-caption-cli

A Python base cli tool for caption images with WD series, Joy-caption-pre-alpha,meta Llama 3.2 Vision Instruct and Qwen2 VL Instruct models.
Apache License 2.0
25 stars 6 forks source link

Peft error #4

Closed specblades closed 1 month ago

specblades commented 1 month ago

Hi Trying to install repo, but falling into error on applying LLM patch. Help me out pls

I ran the script with the command: "python caption.py D:\DATASETS\equals --model_site modelscope --download_method URL --wd_force_use_cpu --wd_remove_underscore --llm_patch"

Loading checkpoint shards: 100%|█████████████████████████████████████████████████████████████| 5/5 [00:47<00:00,  9.42s/it]
2024-10-03 13:41:08,144 - inference.py[line:159] - INFO: Applying LLM Patch...
Traceback (most recent call last):
  File "S:\wd-llm-caption-cli\caption.py", line 645, in <module>
    my_caption.load_models(get_args)
  File "S:\wd-llm-caption-cli\caption.py", line 179, in load_models
    self.my_llama.load_model()
  File "S:\wd-llm-caption-cli\utils\inference.py", line 160, in load_model
    patch_config = PeftConfig.from_pretrained(str(self.llama_patch_path))
  File "S:\wd-llm-caption-cli\venv\lib\site-packages\peft\config.py", line 152, in from_pretrained
    return cls.from_peft_type(**kwargs)
  File "S:\wd-llm-caption-cli\venv\lib\site-packages\peft\config.py", line 119, in from_peft_type
    return config_cls(**kwargs)
TypeError: PeftConfig.__init__() got an unexpected keyword argument 'Code'
fireicewolf commented 1 month ago

Can your manual download adapter_config.json from Llama-3.2-11b-vision-uncensored(modelscope) Then replace it under repo path models/Llama-3.2-11b-vision-Instruct/patch. Retry with same command, see whether this error reproduced.

fireicewolf commented 1 month ago

Emmm. I wroten wrong url in my json config. So if you use url method download, if will return wrong url for llm patches. I will fix this error soon.