hysts HF staff commited on
Commit
f863ebd
1 Parent(s): d1c233a
Files changed (1) hide show
  1. model.py +2 -1
model.py CHANGED
@@ -54,7 +54,8 @@ class Model:
54
  self.pipe = self.load_pipe(base_model_id, task_name)
55
 
56
  def load_pipe(self, base_model_id: str, task_name) -> DiffusionPipeline:
57
- if base_model_id == self.base_model_id and task_name == self.task_name:
 
58
  return self.pipe
59
  model_id = CONTROLNET_MODEL_IDS[task_name]
60
  controlnet = ControlNetModel.from_pretrained(model_id,
 
54
  self.pipe = self.load_pipe(base_model_id, task_name)
55
 
56
  def load_pipe(self, base_model_id: str, task_name) -> DiffusionPipeline:
57
+ if base_model_id == self.base_model_id and task_name == self.task_name and hasattr(
58
+ self, 'pipe'):
59
  return self.pipe
60
  model_id = CONTROLNET_MODEL_IDS[task_name]
61
  controlnet = ControlNetModel.from_pretrained(model_id,