Skip to content

Commit e586ef3

Browse files
committed
update
1 parent a0f1de7 commit e586ef3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/diffusers/hooks/hooks.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414

1515
import functools
16-
from typing import Any, Dict, Tuple
16+
from typing import Any, Dict, Optional, Tuple
1717

1818
import torch
1919

@@ -137,9 +137,9 @@ def new_forward(module, *args, **kwargs):
137137
self.hooks[name] = hook
138138
self._hook_order.append(name)
139139

140-
def get_hook(self, name: str) -> ModelHook:
140+
def get_hook(self, name: str) -> Optional[ModelHook]:
141141
if name not in self.hooks.keys():
142-
raise ValueError(f"Hook with name {name} not found.")
142+
raise None
143143
return self.hooks[name]
144144

145145
def remove_hook(self, name: str) -> None:

0 commit comments

Comments
 (0)