Skip to content

Commit

Permalink
fix: avoid crashing when lora to delete is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
db0 authored and tazlin committed Sep 26, 2024
1 parent 3fd5c68 commit 668dfeb
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 668dfeb

Please sign in to comment.