fix(api): avoid loading encoder twice when using LoRAs and inversions together
This commit is contained in:
parent
9f9b73b780
commit
af326a784f
|
@ -236,14 +236,16 @@ def load_pipeline(
|
||||||
list(zip(inversion_models, inversion_weights, inversion_names)),
|
list(zip(inversion_models, inversion_weights, inversion_names)),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
components["tokenizer"] = tokenizer
|
||||||
|
|
||||||
# should be pretty small and should not need external data
|
# should be pretty small and should not need external data
|
||||||
|
if loras is None or len(loras) == 0:
|
||||||
components["text_encoder"] = OnnxRuntimeModel(
|
components["text_encoder"] = OnnxRuntimeModel(
|
||||||
OnnxRuntimeModel.load_model(
|
OnnxRuntimeModel.load_model(
|
||||||
text_encoder.SerializeToString(),
|
text_encoder.SerializeToString(),
|
||||||
provider=device.ort_provider(),
|
provider=device.ort_provider(),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
components["tokenizer"] = tokenizer
|
|
||||||
|
|
||||||
# test LoRA blending
|
# test LoRA blending
|
||||||
if loras is not None and len(loras) > 0:
|
if loras is not None and len(loras) > 0:
|
||||||
|
|
Loading…
Reference in New Issue