fix: raise and present the runtime error from the exception

This commit is contained in:
blessedcoolant 2024-04-03 20:21:50 +05:30
parent 2dcbb7223b
commit 414851f2f0

View File

@ -152,8 +152,8 @@ class IPAdapter(RawModel):
image_prompt_embeds = self._image_proj_model(clip_image_embeds)
uncond_image_prompt_embeds = self._image_proj_model(torch.zeros_like(clip_image_embeds))
return image_prompt_embeds, uncond_image_prompt_embeds
except RuntimeError:
raise RuntimeError("Selected CLIP Vision Model is incompatible with the current IP Adapter")
except RuntimeError as e:
raise RuntimeError("Selected CLIP Vision Model is incompatible with the current IP Adapter") from e
class IPAdapterPlus(IPAdapter):
@ -181,8 +181,8 @@ class IPAdapterPlus(IPAdapter):
image_prompt_embeds = self._image_proj_model(clip_image_embeds)
uncond_image_prompt_embeds = self._image_proj_model(uncond_clip_image_embeds)
return image_prompt_embeds, uncond_image_prompt_embeds
except RuntimeError:
raise RuntimeError("Selected CLIP Vision Model is incompatible with the current IP Adapter")
except RuntimeError as e:
raise RuntimeError("Selected CLIP Vision Model is incompatible with the current IP Adapter") from e
class IPAdapterFull(IPAdapterPlus):