-
-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow users to switch the currently overriden samplers via the API so a restart isn't required to switch the overrides. Signed-off-by: kingbri <[email protected]>
- Loading branch information
Showing
3 changed files
with
87 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from pydantic import BaseModel, Field | ||
from typing import Optional | ||
|
||
|
||
class SamplerOverrideSwitchRequest(BaseModel): | ||
"""Sampler override switch request""" | ||
|
||
preset: Optional[str] = Field( | ||
default=None, description="Pass a sampler override preset name" | ||
) | ||
|
||
overrides: Optional[dict] = Field( | ||
default=None, | ||
description=( | ||
"Sampling override parent takes in individual keys and overrides." | ||
+ "Ignored if preset is provided." | ||
), | ||
examples=[ | ||
{ | ||
"top_p": { | ||
"override": 1.5, | ||
"force": False, | ||
} | ||
} | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters