[diffusion] feat: support LoRA (#13859)
This commit is contained in:
@@ -351,11 +351,14 @@ class RowParallelLinearWithLoRA(BaseLayerWithLoRA):
|
||||
return B
|
||||
|
||||
|
||||
def get_lora_layer(
|
||||
def wrap_with_lora_layer(
|
||||
layer: nn.Module,
|
||||
lora_rank: int | None = None,
|
||||
lora_alpha: int | None = None,
|
||||
) -> BaseLayerWithLoRA | None:
|
||||
"""
|
||||
transform the given layer to its corresponding LoRA layer
|
||||
"""
|
||||
supported_layer_types: dict[type[LinearBase], type[BaseLayerWithLoRA]] = {
|
||||
# the order matters
|
||||
# VocabParallelEmbedding: VocabParallelEmbeddingWithLoRA,
|
||||
|
||||
Reference in New Issue
Block a user