mirror of
https://github.com/finegrain-ai/refiners.git
synced 2024-11-14 00:58:13 +00:00
Update scripts/convert-lora-weights.py
Co-authored-by: Cédric Deltheil <355031+deltheil@users.noreply.github.com>
This commit is contained in:
parent
c9fba44f39
commit
2ee094c18c
|
@ -57,7 +57,7 @@ def process(source: str, base_model: str, output_file: str) -> None:
|
||||||
diffusers_to_refiners = create_state_dict_mapping(
|
diffusers_to_refiners = create_state_dict_mapping(
|
||||||
source_model=refiners_model, target_model=diffusers_model, source_args=refiners_args, target_args=diffusers_args
|
source_model=refiners_model, target_model=diffusers_model, source_args=refiners_args, target_args=diffusers_args
|
||||||
)
|
)
|
||||||
assert diffusers_to_refiners is not None
|
assert diffusers_to_refiners is not None, "Model conversion failed"
|
||||||
|
|
||||||
apply_loras_to_target(module=refiners_model, target=LoraTarget(target), rank=rank, scale=1.0)
|
apply_loras_to_target(module=refiners_model, target=LoraTarget(target), rank=rank, scale=1.0)
|
||||||
for layer in refiners_model.layers(layer_type=Lora):
|
for layer in refiners_model.layers(layer_type=Lora):
|
||||||
|
|
Loading…
Reference in a new issue