mirror of
https://github.com/theroyallab/tabbyAPI.git
synced 2026-04-20 14:28:54 +00:00
API + Model: Add speculative ngram decoding
Speculative ngram decoding is like speculative decoding without the draft model. It's not as useful because it only decodes on predictable sequences, but it depends on the usecase. Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
@@ -123,6 +123,10 @@ class BaseSamplerRequest(BaseModel):
|
||||
default_factory=lambda: get_default_sampler_value("grammar_string"),
|
||||
)
|
||||
|
||||
speculative_ngram: Optional[bool] = Field(
|
||||
default_factory=lambda: get_default_sampler_value("speculative_ngram"),
|
||||
)
|
||||
|
||||
# Aliased variables
|
||||
typical: Optional[float] = Field(
|
||||
default_factory=lambda: get_default_sampler_value("typical", 1.0),
|
||||
@@ -268,6 +272,7 @@ class BaseSamplerRequest(BaseModel):
|
||||
"negative_prompt": self.negative_prompt,
|
||||
"json_schema": self.json_schema,
|
||||
"grammar_string": self.grammar_string,
|
||||
"speculative_ngram": self.speculative_ngram,
|
||||
}
|
||||
|
||||
return {**gen_params, **kwargs}
|
||||
|
||||
Reference in New Issue
Block a user