Skip to content

Commit

Permalink
Merge pull request #38 from plasma-umass/ignore-litellm-warnings
Browse files Browse the repository at this point in the history
Ignore any warnings LiteLLM might emit on import
  • Loading branch information
stephenfreund authored Apr 8, 2024
2 parents f47eb65 + 7b17579 commit 646d31e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/chatdbg/assistant/assistant.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@
import time
import pprint

import litellm
import warnings

with warnings.catch_warnings():
warnings.simplefilter("ignore")
import litellm

import openai

from ..util.trim import sandwich_tokens, trim_messages
Expand Down
6 changes: 5 additions & 1 deletion src/chatdbg/util/trim.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@

import copy
import litellm
import warnings

with warnings.catch_warnings():
warnings.simplefilter("ignore")
import litellm

def sandwich_tokens(
text: str, model: str, max_tokens: int = 1024, top_proportion: float = 0.5
Expand Down

0 comments on commit 646d31e

Please sign in to comment.