Skip to content

Commit

Permalink
Wrap Literal import in try-except ImportError
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaarsen committed Dec 12, 2023
1 parent 9b9438c commit 944cac0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sentence_transformers/SentenceTransformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 944cac0

Please sign in to comment.