diff --git a/haystack/nodes/prompt/invocation_layer/hugging_face.py b/haystack/nodes/prompt/invocation_layer/hugging_face.py index b68137067..d0a795dc0 100644 --- a/haystack/nodes/prompt/invocation_layer/hugging_face.py +++ b/haystack/nodes/prompt/invocation_layer/hugging_face.py @@ -1,5 +1,6 @@ from typing import Optional, Union, List, Dict import logging +import os import torch @@ -266,6 +267,9 @@ class HFLocalInvocationLayer(PromptModelInvocationLayer): @classmethod def supports(cls, model_name_or_path: str, **kwargs) -> bool: task_name: Optional[str] = None + if os.path.exists(model_name_or_path): + return True + try: task_name = get_task(model_name_or_path, use_auth_token=kwargs.get("use_auth_token", None)) except RuntimeError: