diff --git a/sentence_transformers/SentenceTransformer.py b/sentence_transformers/SentenceTransformer.py index 355fadbdc..7a8d772a1 100644 --- a/sentence_transformers/SentenceTransformer.py +++ b/sentence_transformers/SentenceTransformer.py @@ -4,7 +4,11 @@ import shutil import stat from collections import OrderedDict -from typing import List, Dict, Tuple, Iterable, Type, Union, Callable, Optional, Literal +from typing import List, Dict, Tuple, Iterable, Type, Union, Callable, Optional +try: + from typing import Literal +except ImportError: + from typing_extensions import Literal import numpy as np from numpy import ndarray import transformers