mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 19:24:27 +00:00
(fix) router
This commit is contained in:
parent
cde8996798
commit
616b876f23
1 changed files with 2 additions and 1 deletions
|
@ -365,10 +365,11 @@ class Router:
|
||||||
self.print_verbose(f'Response: {response}')
|
self.print_verbose(f'Response: {response}')
|
||||||
return response
|
return response
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.print_verbose(f"An exception occurs")
|
|
||||||
original_exception = e
|
original_exception = e
|
||||||
|
self.print_verbose(f"An exception occurs{original_exception}")
|
||||||
try:
|
try:
|
||||||
self.print_verbose(f"Trying to fallback b/w models")
|
self.print_verbose(f"Trying to fallback b/w models")
|
||||||
|
fallback_model_group = []
|
||||||
if isinstance(e, litellm.ContextWindowExceededError):
|
if isinstance(e, litellm.ContextWindowExceededError):
|
||||||
for item in self.context_window_fallback_model_group: # [{"gpt-3.5-turbo": ["gpt-4"]}]
|
for item in self.context_window_fallback_model_group: # [{"gpt-3.5-turbo": ["gpt-4"]}]
|
||||||
if list(item.keys())[0] == model_group:
|
if list(item.keys())[0] == model_group:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue