mirror of
https://github.com/theroyallab/tabbyAPI.git
synced 2026-04-29 02:31:48 +00:00
OAI: Add validation to "n"
n must be greater than 1 to generate. Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
@@ -49,6 +49,13 @@ class CommonCompletionRequest(BaseSamplerRequest):
|
|||||||
description="Not parsed. Only used for OAI compliance.", default=None
|
description="Not parsed. Only used for OAI compliance.", default=None
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def validate_params(self):
|
||||||
|
# Temperature
|
||||||
|
if self.n < 1:
|
||||||
|
raise ValueError(f"n must be greater than or equal to 1. Got {self.n}")
|
||||||
|
|
||||||
|
return super().validate_params()
|
||||||
|
|
||||||
def to_gen_params(self):
|
def to_gen_params(self):
|
||||||
extra_gen_params = {
|
extra_gen_params = {
|
||||||
"stream": self.stream,
|
"stream": self.stream,
|
||||||
|
|||||||
Reference in New Issue
Block a user