Skip to content

Commit

Permalink
Merge pull request #130 from ssbuild/dev
Browse files Browse the repository at this point in the history
remove underscore_attrs_are_private
  • Loading branch information
ssbuild authored Nov 17, 2023
2 parents 4f33b9a + 0639350 commit 6918319
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions serving/openai_api/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# @Time : 2023/8/11 15:31
from typing import Optional, Union, List, Dict, Any
from pydantic import BaseModel
from pydantic.v1 import PrivateAttr

__all__ = [
'CustomChatParams'
Expand Down Expand Up @@ -45,10 +46,11 @@ class CustomChatParams(BaseModel):
functions: Optional[List[Dict[str, Any]]] = None
function_call: Union[str, Dict[str, str]] = "auto"

class Config:
underscore_attrs_are_private = True
# 私有成员
_model_type: Optional[str] = None
# class Config:
# underscore_attrs_are_private = True
# _model_type: Optional[str] = None

_model_type: Optional[str] = PrivateAttr(default=None)

@property
def model_type(self):
Expand Down

0 comments on commit 6918319

Please sign in to comment.