1.Change the name of is_fastapi_available function

2. Added the log of printing requests when deploying using vllm
This commit is contained in:
Tendo33
2024-05-09 14:28:01 +08:00
parent d9cdddd19c
commit fd2e6dec58
4 changed files with 64 additions and 33 deletions

View File

@@ -6,11 +6,11 @@ if TYPE_CHECKING:
from pydantic import BaseModel
def dictify(data: "BaseModel") -> Dict[str, Any]:
def dictify(data: "BaseModel", **kwargs) -> Dict[str, Any]:
try: # pydantic v2
return data.model_dump(exclude_unset=True)
return data.model_dump(**kwargs)
except AttributeError: # pydantic v1
return data.dict(exclude_unset=True)
return data.dict(**kwargs)
def jsonify(data: "BaseModel") -> str: