File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change 22from keras .saving import register_keras_serializable as serializable
33
44from bayesflow .types import Tensor
5- from bayesflow .utils import logging , keras_kwargs
5+ from bayesflow .utils import keras_kwargs
66from bayesflow .utils .decorators import sanitize_input_shape
77
8- try :
9- from mamba_ssm import Mamba
10- except ImportError :
11- logging .error ("Mamba class is not available. Please, install the mamba-ssm library via `pip install mamba-ssm`." )
12-
138
149@serializable ("bayesflow.wrappers" )
1510class MambaBlock (keras .Layer ):
@@ -60,8 +55,13 @@ def __init__(
6055
6156 super ().__init__ (** keras_kwargs (kwargs ))
6257
63- if keras .backend .backend () != "torch" :
64- raise RuntimeError ("Mamba is only available using torch backend." )
58+ # if keras.backend.backend() != "torch":
59+ # raise RuntimeError("Mamba is only available using torch backend.")
60+
61+ try :
62+ from mamba_ssm import Mamba
63+ except ImportError as e :
64+ raise ImportError ("Could not import Mamba. Please install it via `pip install mamba-ssm`" ) from e
6565
6666 self .bidirectional = bidirectional
6767
You can’t perform that action at this time.
0 commit comments