From c6e6afd125a32d1f36123b43114f6f6ed042d1dd Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Tue, 5 Mar 2024 18:41:39 -0800 Subject: [PATCH 1/2] (fix) bug importing litellm --- litellm/llms/bedrock.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/litellm/llms/bedrock.py b/litellm/llms/bedrock.py index 79ba04f42..89d1bf16f 100644 --- a/litellm/llms/bedrock.py +++ b/litellm/llms/bedrock.py @@ -376,7 +376,7 @@ class AmazonMistralConfig: temperature: Optional[float] = None top_p: Optional[float] = None top_k: Optional[float] = None - stop: Optional[list[str]] = None + stop: Optional[List[str]] = None def __init__( self, @@ -384,7 +384,7 @@ class AmazonMistralConfig: temperature: Optional[float] = None, top_p: Optional[int] = None, top_k: Optional[float] = None, - stop: Optional[list[str]] = None, + stop: Optional[List[str]] = None, ) -> None: locals_ = locals() for key, value in locals_.items(): From bbdac823f48b3b5b483b1584dac0a2d08da32240 Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Tue, 5 Mar 2024 18:45:47 -0800 Subject: [PATCH 2/2] (fix) using litellm on python 3.8 --- litellm/llms/prompt_templates/factory.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/litellm/llms/prompt_templates/factory.py b/litellm/llms/prompt_templates/factory.py index c78a71dba..b49cae5f3 100644 --- a/litellm/llms/prompt_templates/factory.py +++ b/litellm/llms/prompt_templates/factory.py @@ -2,7 +2,7 @@ from enum import Enum import requests, traceback import json, re, xml.etree.ElementTree as ET from jinja2 import Template, exceptions, Environment, meta -from typing import Optional, Any +from typing import Optional, Any, List import imghdr, base64 @@ -586,7 +586,7 @@ def anthropic_messages_pt(messages: list): return new_messages -def extract_between_tags(tag: str, string: str, strip: bool = False) -> list[str]: +def extract_between_tags(tag: str, string: str, strip: bool = False) -> List[str]: ext_list = re.findall(f"<{tag}>(.+?)", string, re.DOTALL) if strip: ext_list = [e.strip() for e in ext_list]