Catch OSError while trying to load cached model

#28
Files changed (1) hide show
  1. models.py +1 -1
models.py CHANGED
@@ -535,7 +535,7 @@ class StableAudWrapper(PipelineWrapper):
535
  try:
536
  self.model = StableAudioPipeline.from_pretrained(self.model_id, token=self.token, local_files_only=True
537
  ).to(self.device)
538
- except FileNotFoundError:
539
  self.model = StableAudioPipeline.from_pretrained(self.model_id, token=self.token, local_files_only=False
540
  ).to(self.device)
541
  self.model.transformer.eval()
 
535
  try:
536
  self.model = StableAudioPipeline.from_pretrained(self.model_id, token=self.token, local_files_only=True
537
  ).to(self.device)
538
+ except (FileNotFoundError, OSError):
539
  self.model = StableAudioPipeline.from_pretrained(self.model_id, token=self.token, local_files_only=False
540
  ).to(self.device)
541
  self.model.transformer.eval()