Skip to content

Commit

Permalink
Merge pull request #341 from Haidra-Org/main
Browse files Browse the repository at this point in the history
fix: avoid crashing when lora to delete is missing
  • Loading branch information
tazlin authored Sep 26, 2024
2 parents 60b297d + 668dfeb commit 181e61a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion hordelib/model_manager/lora.py
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,10 @@ def delete_unused_loras(self, timeout=0):
time.sleep(0.2)
loras_to_delete = self.find_unused_loras()
for lora_filename in loras_to_delete:
self.delete_lora_files(lora_filename)
try:
self.delete_lora_files(lora_filename)
except FileNotFoundError:
logger.warning(f"Expected to delete lora file {lora_filename} but it was not found.")
return loras_to_delete

def delete_lora_files(self, lora_filename: str):
Expand Down

0 comments on commit 181e61a

Please sign in to comment.