This PR removes all global state. Namely, I remove the xlora_state module. The xLoRA Classifier attribute is injected into the PeftModel like how the methods are injected, and the scalings attribute is done similarly.
I also remove the forward pass hook, replacing it by modifying the BaseTunerWrapper.forward function such that it executes the function. Additionally, some other small changes were made, such as setting the PeftModel scalings attribute in the xLoRAClassifier.forward instead of in the now nonexistent hook.
Changes
Remove xlora_state module
Inject 2 new attributes into the PeftModel to replace the global state.
Inject the associated functions into the PeftModel as the state is now stored nicely alongside them.
Remove the forward pass hook by modifying an existing indirection function to perform the same task.
Set the scalings attribute in the xLoRA Classifier forward function
Overview
This PR removes all global state. Namely, I remove the
xlora_state
module. The xLoRA Classifier attribute is injected into the PeftModel like how the methods are injected, and the scalings attribute is done similarly.I also remove the forward pass hook, replacing it by modifying the
BaseTunerWrapper.forward
function such that it executes the function. Additionally, some other small changes were made, such as setting the PeftModel scalings attribute in thexLoRAClassifier.forward
instead of in the now nonexistent hook.Changes
xlora_state
module