Unverified Commit 35a969d2 authored by YShow's avatar YShow Committed by GitHub
Browse files

[Training] remove depcreated method from lora scripts again (#6266)

* remove depcreated method from lora scripts

* check code quality
parent c5ff469d
......@@ -22,7 +22,6 @@ import os
import random
import shutil
from pathlib import Path
from typing import Dict
import datasets
import numpy as np
......@@ -436,22 +435,6 @@ DATASET_NAME_MAPPING = {
}
def unet_attn_processors_state_dict(unet) -> Dict[str, torch.tensor]:
"""
Returns:
a state dict containing just the attention processor parameters.
"""
attn_processors = unet.attn_processors
attn_processors_state_dict = {}
for attn_processor_key, attn_processor in attn_processors.items():
for parameter_key, parameter in attn_processor.state_dict().items():
attn_processors_state_dict[f"{attn_processor_key}.{parameter_key}"] = parameter
return attn_processors_state_dict
def tokenize_prompt(tokenizer, prompt):
text_inputs = tokenizer(
prompt,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment