peft icon indicating copy to clipboard operation
peft copied to clipboard

loftq_utils.py depdends on huggingface_hub.errors, which doesn't appear in some versions of huggingface_hub

Open mashoutsider opened this issue 1 year ago • 1 comments

System Info

loftq_utils.py refers to huggingface_hub.errors

Should the requirements.txt include huggingface_hub?

I have huggingface_hub version 0.19.4 and it does not have huggingface_hub.errors.

Is there a workaround or another version of huggingface_hub?

Who can help?

No response

Information

  • [X] The official example scripts
  • [ ] My own modified scripts

Tasks

  • [ ] An officially supported task in the examples folder
  • [X] My own task or dataset (give details below)

Reproduction

Should the requirements.txt include huggingface_hub?

I have huggingface_hub version 0.19.4 and it does not have huggingface_hub.errors.

Is there a workaround or another version of huggingface_hub?

Expected behavior

Should the requirements.txt include huggingface_hub?

I have huggingface_hub version 0.19.4 and it does not have huggingface_hub.errors.

Is there a workaround or another version of huggingface_hub?

mashoutsider avatar Sep 25 '24 18:09 mashoutsider

It's true that we don't explicitly list huggingface_hub as a requirement, but it's an indirect requirement (e.g. it's a requirement of accelerate which is a requirement of PEFT). For your specific problem, I think it can easily be solved if the error is imported from huggingface_hub.utils instead. I tested this locally with v0.19.4 and it worked. Would you like to create a PR for this?

BenjaminBossan avatar Sep 26 '24 08:09 BenjaminBossan

I'm also getting ModuleNotFoundError: No module named 'huggingface_hub.errors' when importing from peft import AutoPeftModelForCausalLM.

Tried on a new env with python 3.10 and pip install transformers peft. Not sure how to fix this.

saeedesmaili avatar Oct 25 '24 09:10 saeedesmaili

Yeah, it's the same issue most likely, with the fix I mentioned above. What version of huggingface_hub are you using? Could you try downgrading it?

BenjaminBossan avatar Oct 25 '24 09:10 BenjaminBossan

I upgraded transformers and xformers and one of them helped to fix the issue.

saeedesmaili avatar Oct 25 '24 09:10 saeedesmaili