mirror of
https://github.com/NVIDIA/TensorRT-LLM.git
synced 2026-01-14 06:27:45 +08:00
fix: Align default setting & remove unnecessary check for chat and completion (#3888)
Signed-off-by: Pengyun Lin <81065165+LinPoly@users.noreply.github.com>
This commit is contained in:
parent
4d0e462723
commit
721f84a0ac
@ -234,9 +234,8 @@ class CompletionRequest(OpenAIBaseModel):
|
||||
@model_validator(mode="before")
|
||||
@classmethod
|
||||
def check_logprobs(cls, data):
|
||||
if ("top_logprobs" in data and data.get("top_logprobs")) or \
|
||||
("logprobs" in data and data.get("logprobs")):
|
||||
raise ValueError("returning log probs is not supported")
|
||||
if data.get("logprobs"):
|
||||
raise ValueError("logprobs is not supported")
|
||||
return data
|
||||
|
||||
@model_validator(mode="before")
|
||||
@ -270,15 +269,6 @@ class CompletionRequest(OpenAIBaseModel):
|
||||
raise ValueError("suffix is not supported")
|
||||
return data
|
||||
|
||||
@model_validator(mode="before")
|
||||
@classmethod
|
||||
def check_special_tokens(cls, data):
|
||||
if data.get("skip_special_tokens") or data.get("add_special_tokens") or \
|
||||
data.get("spaces_between_special_tokens"):
|
||||
raise ValueError(
|
||||
"special_tokens related settings are not supported")
|
||||
return data
|
||||
|
||||
|
||||
class FunctionCall(OpenAIBaseModel):
|
||||
name: str
|
||||
@ -425,7 +415,7 @@ class ChatCompletionRequest(OpenAIBaseModel):
|
||||
stop: Optional[Union[str, List[str]]] = Field(default_factory=list)
|
||||
stream: Optional[bool] = False
|
||||
stream_options: Optional[StreamOptions] = None
|
||||
temperature: Optional[float] = 0.7
|
||||
temperature: Optional[float] = 1.0
|
||||
top_p: Optional[float] = 1.0
|
||||
tools: Optional[List[ChatCompletionToolsParam]] = None
|
||||
tool_choice: Optional[Union[Literal["none"],
|
||||
@ -606,15 +596,6 @@ class ChatCompletionRequest(OpenAIBaseModel):
|
||||
raise ValueError("suffix is not supported")
|
||||
return data
|
||||
|
||||
@model_validator(mode="before")
|
||||
@classmethod
|
||||
def check_special_tokens(cls, data):
|
||||
if data.get("skip_special_tokens") or data.get("add_special_tokens") or \
|
||||
data.get("spaces_between_special_tokens"):
|
||||
raise ValueError(
|
||||
"special_tokens related settings are not supported")
|
||||
return data
|
||||
|
||||
|
||||
def encode_opaque_state(opaque_state: Optional[bytes]) -> Optional[str]:
|
||||
if opaque_state is None:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user