diff --git a/unstructured/utils.py b/unstructured/utils.py index f83f8831a2..8d6543e090 100644 --- a/unstructured/utils.py +++ b/unstructured/utils.py @@ -10,7 +10,7 @@ import subprocess import tempfile import threading -from functools import wraps +from functools import lru_cache, wraps from itertools import combinations from typing import ( TYPE_CHECKING, @@ -227,6 +227,7 @@ async def wrapper_async(*args: _P.args, **kwargs: _P.kwargs): return decorator +@lru_cache(maxsize=128) def dependency_exists(dependency: str): try: importlib.import_module(dependency)