Skip to content

Commit

Permalink
Fix error with changed LiteLLM exception type, closes #620
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmezzetti committed Dec 22, 2023
1 parent f9229bc commit 2eca3e8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/python/txtai/pipeline/llm/litellm.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@ def ismodel(path):
True if this is a LiteLLM model, False otherwise
"""

# pylint: disable=W0702
if isinstance(path, str) and LITELLM:
with open(os.devnull, "w", encoding="utf-8") as f, contextlib.redirect_stdout(f):
try:
return api.get_llm_provider(path)
except ValueError:
except:
return False

return False
Expand Down

0 comments on commit 2eca3e8

Please sign in to comment.