guidance icon indicating copy to clipboard operation
guidance copied to clipboard

Update guidance with the mode of PEFT

Open HelloWorldLTY opened this issue 1 year ago • 5 comments

Hi, I notice that the function of PEFT is still under construction. Therefore, I update guidance with PEFT. Could you please review this code and merge it? Thanks.

HelloWorldLTY avatar Feb 23 '24 21:02 HelloWorldLTY

@HelloWorldLTY thanks, this looks great! Can you add at least one unit test to make sure this continues to work in the future? Thanks.

slundberg avatar Mar 04 '24 17:03 slundberg

Sure, I will do that asap. Thanks.

HelloWorldLTY avatar Mar 07 '24 18:03 HelloWorldLTY

Hi, I have added a unit test known as test_peft.py file. I did not test inference since it required extra files. Do I need to handle other conflict files? Thanks.

HelloWorldLTY avatar Mar 07 '24 21:03 HelloWorldLTY

Thanks. The test currently just tests the HF code though not the new changes here :)

Also looking through this again I realized I think this also works right?

pmodel = PeftModel.from_pretrained(model, peft_model_id)
guidance.models.Transformers(pmodel, tokenizer)

If so that is probably the best way to handle this since other wise we are just rewrapping the PeftModel.from_pretrained constructor.

slundberg avatar Mar 08 '24 01:03 slundberg

I think so, this is anothe alternative approach. Moreover, installing peft is still the required step I think. Do I need to modify the readme file to implement your suggestions?

HelloWorldLTY avatar Mar 09 '24 23:03 HelloWorldLTY