Spaces:
Runtime error
Runtime error
test lora load
Browse files- scripts/process_utils.py +4 -4
scripts/process_utils.py
CHANGED
@@ -52,7 +52,7 @@ def initialize(_use_local=False, use_gpu=False, use_dotenv=False):
|
|
52 |
|
53 |
def load_lora(pipeline, lora_path, alpha=0.75):
|
54 |
pipeline.load_lora_weights(lora_path)
|
55 |
-
pipeline.fuse_lora(lora_scale=alpha)
|
56 |
|
57 |
def initialize_sotai_model():
|
58 |
global device, torch_dtype
|
@@ -99,9 +99,9 @@ def initialize_sotai_model():
|
|
99 |
# (os.environ["lora_name2"], 0.3),
|
100 |
]
|
101 |
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
|
106 |
# スケジューラーの設定
|
107 |
sotai_gen_pipe.scheduler = UniPCMultistepScheduler.from_config(sotai_gen_pipe.scheduler.config)
|
|
|
52 |
|
53 |
def load_lora(pipeline, lora_path, alpha=0.75):
|
54 |
pipeline.load_lora_weights(lora_path)
|
55 |
+
# pipeline.fuse_lora(lora_scale=alpha)
|
56 |
|
57 |
def initialize_sotai_model():
|
58 |
global device, torch_dtype
|
|
|
99 |
# (os.environ["lora_name2"], 0.3),
|
100 |
]
|
101 |
|
102 |
+
for lora_name, alpha in lora_names:
|
103 |
+
lora_path = get_file_path(lora_name, subfolder=os.environ["lora_dir"])
|
104 |
+
load_lora(sotai_gen_pipe, lora_path, alpha)
|
105 |
|
106 |
# スケジューラーの設定
|
107 |
sotai_gen_pipe.scheduler = UniPCMultistepScheduler.from_config(sotai_gen_pipe.scheduler.config)
|