From ebcedc35de4ba3e2c5017ff537ebcc007cc292d0 Mon Sep 17 00:00:00 2001 From: Aaron <29749331+aarnphm@users.noreply.github.com> Date: Tue, 13 Jun 2023 20:15:38 -0400 Subject: [PATCH] fix(exception): handle notfound explicitly Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com> --- src/openllm/_llm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openllm/_llm.py b/src/openllm/_llm.py index db28889a..3c0ac096 100644 --- a/src/openllm/_llm.py +++ b/src/openllm/_llm.py @@ -630,7 +630,7 @@ class LLM(LLMInterface, t.Generic[_M, _T], metaclass=LLMMetaclass): tag, kwds = self.make_tag(return_unused_kwargs=True, trust_remote_code=trust_remote_code, **self._llm_attrs) try: return bentoml.transformers.get(tag) - except bentoml.exceptions.BentoMLException: + except bentoml.exceptions.NotFound: logger.info("'%s' with tag (%s) not found, importing from HuggingFace Hub.", self.__class__.__name__, tag) tokenizer_kwds = {k[len("_tokenizer_") :]: v for k, v in kwds.items() if k.startswith("_tokenizer_")} kwds = {k: v for k, v in kwds.items() if not k.startswith("_tokenizer_")}