1
0
Fork 0

fix(api): avoid loading encoder twice when using LoRAs and inversions together

This commit is contained in:
Sean Sube 2023-03-18 13:39:35 -05:00
parent 9f9b73b780
commit af326a784f
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
1 changed files with 9 additions and 7 deletions

View File

@ -236,14 +236,16 @@ def load_pipeline(
list(zip(inversion_models, inversion_weights, inversion_names)),
)
components["tokenizer"] = tokenizer
# should be pretty small and should not need external data
if loras is None or len(loras) == 0:
components["text_encoder"] = OnnxRuntimeModel(
OnnxRuntimeModel.load_model(
text_encoder.SerializeToString(),
provider=device.ort_provider(),
)
)
components["tokenizer"] = tokenizer
# test LoRA blending
if loras is not None and len(loras) > 0: