From 060acbc524809226c4f05ee069ab05f01d4b659a Mon Sep 17 00:00:00 2001 From: Timo Imhof Date: Mon, 24 Feb 2025 12:44:56 +0100 Subject: [PATCH] Add python version compatibility check for Unpack operator --- src/adapters/models/mistral/modeling_mistral.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/adapters/models/mistral/modeling_mistral.py b/src/adapters/models/mistral/modeling_mistral.py index 14cc47615..f8925ba82 100644 --- a/src/adapters/models/mistral/modeling_mistral.py +++ b/src/adapters/models/mistral/modeling_mistral.py @@ -18,7 +18,13 @@ # See the License for the specific language governing permissions and # limitations under the License. """PyTorch Mistral model.""" -from typing import Callable, Optional, Tuple, Unpack +from typing import Callable, Optional, Tuple + + +try: + from typing import Unpack +except ImportError: + from typing_extensions import Unpack import torch import torch.utils.checkpoint