mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-12-16 20:00:36 +08:00
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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user