forked from phoenix/litellm-mirror
Merge pull request #2344 from BerriAI/litellm_fix_cant_import_litellm
(fix) bug importing litellm on python 3.8
This commit is contained in:
commit
a514eae85b
2 changed files with 4 additions and 4 deletions
|
@ -376,7 +376,7 @@ class AmazonMistralConfig:
|
||||||
temperature: Optional[float] = None
|
temperature: Optional[float] = None
|
||||||
top_p: Optional[float] = None
|
top_p: Optional[float] = None
|
||||||
top_k: Optional[float] = None
|
top_k: Optional[float] = None
|
||||||
stop: Optional[list[str]] = None
|
stop: Optional[List[str]] = None
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
|
@ -384,7 +384,7 @@ class AmazonMistralConfig:
|
||||||
temperature: Optional[float] = None,
|
temperature: Optional[float] = None,
|
||||||
top_p: Optional[int] = None,
|
top_p: Optional[int] = None,
|
||||||
top_k: Optional[float] = None,
|
top_k: Optional[float] = None,
|
||||||
stop: Optional[list[str]] = None,
|
stop: Optional[List[str]] = None,
|
||||||
) -> None:
|
) -> None:
|
||||||
locals_ = locals()
|
locals_ = locals()
|
||||||
for key, value in locals_.items():
|
for key, value in locals_.items():
|
||||||
|
|
|
@ -2,7 +2,7 @@ from enum import Enum
|
||||||
import requests, traceback
|
import requests, traceback
|
||||||
import json, re, xml.etree.ElementTree as ET
|
import json, re, xml.etree.ElementTree as ET
|
||||||
from jinja2 import Template, exceptions, Environment, meta
|
from jinja2 import Template, exceptions, Environment, meta
|
||||||
from typing import Optional, Any
|
from typing import Optional, Any, List
|
||||||
import imghdr, base64
|
import imghdr, base64
|
||||||
|
|
||||||
|
|
||||||
|
@ -586,7 +586,7 @@ def anthropic_messages_pt(messages: list):
|
||||||
return new_messages
|
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}>(.+?)</{tag}>", string, re.DOTALL)
|
ext_list = re.findall(f"<{tag}>(.+?)</{tag}>", string, re.DOTALL)
|
||||||
if strip:
|
if strip:
|
||||||
ext_list = [e.strip() for e in ext_list]
|
ext_list = [e.strip() for e in ext_list]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue