getao/icae

Use standard peft

Closed this issue · 3 comments

Hi,

Thanks for sharing the code for the inspirational work. How can I adapt the lora weight to the standard peft package for our application? What customization is performed in the provided peft package? It would be really helpful if you could provide some pointers for transferring to the recent peft version.

Thanks!

If anyone is trying to do the same thing, I figured out a way to do it. The inference output using standard/recent peft is identical to that of the author's customized peft. Follow these steps (I am using peft 0.7.1, recent update should still be similar):

1, remove enable_lora argument in line 306 and 308

2, to get compressed/memory output as in the inference code call

model.icae.enable_adapter_layers()
compress_outputs = model.icae(inputs_embeds=autoencoder_input_embedding, output_hidden_states=True,
                              enable_lora=True)
model.icae.disable_adapter_layers()

This only works for inference. It is not apparent how to train using recent peft. Maybe authors can add more input.

You can refer to this issue: #4 to add a context manager statement to disable the lora part.

We'll update the repo next month to include more details.

Updated