Sampling: Reorder aliased params and add kobold aliases
Also add dynatemp range which is an alternative way of calculating min and max temp. Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
parent
7522b1447b
commit
ea80b62e30
2 changed files with 39 additions and 31 deletions
|
|
@ -2,7 +2,7 @@ from typing import List, Optional
|
|||
|
||||
from pydantic import BaseModel, Field
|
||||
from common import model
|
||||
from common.sampling import BaseSamplerRequest
|
||||
from common.sampling import BaseSamplerRequest, get_default_sampler_value
|
||||
from common.utils import flat_map, unwrap
|
||||
|
||||
|
||||
|
|
@ -10,12 +10,19 @@ class GenerateRequest(BaseSamplerRequest):
|
|||
prompt: str
|
||||
genkey: Optional[str] = None
|
||||
use_default_badwordsids: Optional[bool] = False
|
||||
dynatemp_range: Optional[float] = Field(
|
||||
default_factory=get_default_sampler_value("dynatemp_range")
|
||||
)
|
||||
|
||||
def to_gen_params(self, **kwargs):
|
||||
# Exl2 uses -1 to include all tokens in repetition penalty
|
||||
if self.penalty_range == 0:
|
||||
self.penalty_range = -1
|
||||
|
||||
if self.dynatemp_range:
|
||||
self.min_temp = self.temperature - self.dynatemp_range
|
||||
self.max_temp = self.temperature + self.dynatemp_range
|
||||
|
||||
# Move badwordsids into banned tokens for generation
|
||||
if self.use_default_badwordsids:
|
||||
bad_words_ids = unwrap(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue