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

ImportError: cannot import name 'VBLoRAConfig' from 'peft' #2072

Closed
2 of 4 tasks
KQDtianxiaK opened this issue Sep 17, 2024 · 4 comments
Closed
2 of 4 tasks

ImportError: cannot import name 'VBLoRAConfig' from 'peft' #2072

KQDtianxiaK opened this issue Sep 17, 2024 · 4 comments

Comments

@KQDtianxiaK
Copy link

System Info

RTX 4090D(24GB)
peft == 0.12.0
transformers == 4.44.0
Has this method been removed?

Who can help?

No response

Information

  • The official example scripts
  • My own modified scripts

Tasks

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

Reproduction

from peft import VBLoRAConfig, get_peft_model, TaskType, AutoPeftModelForSequenceClassification
model = AutoModelForSequenceClassification.from_pretrained(model_name, num_labels=2)
config = VBLoRAConfig( task_type=TaskType.SEQ_CLS, target_modules=['key','value','query'], num_vectors=60, vector_length=256, save_only_topk_weights=Flase )
model_VBLoRA = get_peft_model(model, config)

Expected behavior

Get an answer to solve this problem

@BenjaminBossan
Copy link
Member

VB-LoRA has been merged very recently and thus is not yet part of any PEFT release. You can either wait until the next PEFT release (my estimation is within the next 2 weeks) or you install PEFT from source: python -m pip install git+https://github.com/huggingface/peft.

@KQDtianxiaK
Copy link
Author

VB-LoRA has been merged very recently and thus is not yet part of any PEFT release. You can either wait until the next PEFT release (my estimation is within the next 2 weeks) or you install PEFT from source: python -m pip install git+https://github.com/huggingface/peft.

Thank you for your prompt and accurate reply, I will look forward to the next version.
In addition, I have another question: why the peft library does not have adapters proposed by the paper "Parameter-efficient transfer learning for NLP" so far?

@BenjaminBossan
Copy link
Member

why the peft library does not have adapters proposed by the paper "Parameter-efficient transfer learning for NLP" so far?

The answer to this type of question is: Because nobody created a PR to add it :) Yes, sometimes the PEFT maintainers (which is just me at the moment) will go ahead and implement a particularly promising method. But in general this takes time that we don't have, so we mostly rely on community contributions.

See also #244.

@KQDtianxiaK
Copy link
Author

KQDtianxiaK commented Sep 17, 2024

why the peft library does not have adapters proposed by the paper "Parameter-efficient transfer learning for NLP" so far?

The answer to this type of question is: Because nobody created a PR to add it :) Yes, sometimes the PEFT maintainers (which is just me at the moment) will go ahead and implement a particularly promising method. But in general this takes time that we don't have, so we mostly rely on community contributions.

See also #244.

Thanks for your answers and all the contributors, hope one day I can be one of 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

2 participants