Sampling: Make add_bos_token override concise

Also set the default to None so text completions follows the same
pattern.

Signed-off-by: kingbri <8082010+kingbri1@users.noreply.github.com>
This commit is contained in:
kingbri 2025-05-10 19:07:35 -04:00
parent 656af41b5d
commit 6379081dd8
3 changed files with 3 additions and 3 deletions

View file

@ -205,7 +205,7 @@ class BaseSamplerRequest(BaseModel):
) )
add_bos_token: Optional[bool] = Field( add_bos_token: Optional[bool] = Field(
default_factory=lambda: get_default_sampler_value("add_bos_token", True) default_factory=lambda: get_default_sampler_value("add_bos_token")
) )
ban_eos_token: Optional[bool] = Field( ban_eos_token: Optional[bool] = Field(

View file

@ -84,7 +84,7 @@ class ChatCompletionRequest(CommonCompletionRequest):
# Chat completions requests do not have a BOS token preference. Backend # Chat completions requests do not have a BOS token preference. Backend
# respects the tokenization config for the individual model. # respects the tokenization config for the individual model.
add_bos_token: Optional[bool] = Field(default=None) add_bos_token: Optional[bool] = None
@field_validator("add_bos_token", mode="after") @field_validator("add_bos_token", mode="after")
def force_bos_token(cls, v): def force_bos_token(cls, v):

View file

@ -131,7 +131,7 @@ mirostat_eta:
# MARK: Token options # MARK: Token options
add_bos_token: add_bos_token:
override: true override:
force: false force: false
ban_eos_token: ban_eos_token:
override: false override: false