Skip to content

Commit

Permalink
Sanity check: don't try to load LoRas if there are none to load
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk-dev committed Jul 16, 2024
1 parent 42343c4 commit c62d2dc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions runner/app/pipelines/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ def load_loras(pipeline: any, requested_loras: str):
pipeline: Diffusion pipeline, usually available under self.ldm.
loras: JSON string with key-value pairs, where the key is the repository to load LoRas from and the value is the strength (float with a minimum value of 0.0) to assign to the LoRa.
"""
# No LoRas to load
if requested_loras == "" or requested_loras == None:
return;
# Parse LoRas param as JSON to extract key-value pairs
loras = json.loads(requested_loras)
# Build a list of adapter names and their requested strength
Expand Down

0 comments on commit c62d2dc

Please sign in to comment.