[Rust Frontend] Forward per-request watermarking controls (#56338)
Co-authored-by: Codex <noreply@openai.com> Signed-off-by: NickLucche <nicolo.lucchesi@mistral.ai>
This commit is contained in:
@@ -92,6 +92,7 @@ pub fn lower_sampling_params(
|
||||
) -> Result<EngineCoreSamplingParams> {
|
||||
let SamplingParams {
|
||||
temperature,
|
||||
watermarking,
|
||||
top_p,
|
||||
top_k,
|
||||
seed,
|
||||
@@ -164,6 +165,7 @@ pub fn lower_sampling_params(
|
||||
|
||||
let params = EngineCoreSamplingParams {
|
||||
temperature,
|
||||
watermarking,
|
||||
top_p,
|
||||
top_k,
|
||||
seed,
|
||||
@@ -632,6 +634,7 @@ mod tests {
|
||||
expect_test::expect![[r#"
|
||||
EngineCoreSamplingParams {
|
||||
temperature: 1.0,
|
||||
watermarking: true,
|
||||
top_p: 1.0,
|
||||
top_k: 0,
|
||||
seed: None,
|
||||
@@ -686,6 +689,7 @@ mod tests {
|
||||
expect_test::expect![[r#"
|
||||
EngineCoreSamplingParams {
|
||||
temperature: 1.0,
|
||||
watermarking: true,
|
||||
top_p: 1.0,
|
||||
top_k: 0,
|
||||
seed: None,
|
||||
@@ -854,6 +858,7 @@ mod tests {
|
||||
expect_test::expect![[r#"
|
||||
EngineCoreSamplingParams {
|
||||
temperature: 0.6,
|
||||
watermarking: true,
|
||||
top_p: 0.95,
|
||||
top_k: 20,
|
||||
seed: None,
|
||||
@@ -918,6 +923,7 @@ mod tests {
|
||||
expect_test::expect![[r#"
|
||||
EngineCoreSamplingParams {
|
||||
temperature: 1.0,
|
||||
watermarking: true,
|
||||
top_p: 1.0,
|
||||
top_k: 0,
|
||||
seed: None,
|
||||
@@ -990,6 +996,7 @@ mod tests {
|
||||
expect_test::expect![[r#"
|
||||
EngineCoreSamplingParams {
|
||||
temperature: 0.2,
|
||||
watermarking: true,
|
||||
top_p: 0.3,
|
||||
top_k: 4,
|
||||
seed: None,
|
||||
@@ -1240,6 +1247,7 @@ mod tests {
|
||||
expect_test::expect![[r#"
|
||||
EngineCoreSamplingParams {
|
||||
temperature: 0.8,
|
||||
watermarking: true,
|
||||
top_p: 0.9,
|
||||
top_k: 12,
|
||||
seed: None,
|
||||
|
||||
@@ -69,6 +69,8 @@ pub struct SamplingParams {
|
||||
/// Controls randomness. Lower values are more deterministic; zero means
|
||||
/// greedy sampling. `None` means no explicit user override.
|
||||
pub temperature: Option<f32>,
|
||||
/// Whether to apply the engine's configured watermark to this request.
|
||||
pub watermarking: bool,
|
||||
/// Cumulative probability threshold for nucleus sampling.
|
||||
pub top_p: Option<f32>,
|
||||
/// Maximum number of top tokens to consider. `Some(0)` means all tokens.
|
||||
@@ -144,6 +146,7 @@ impl Default for SamplingParams {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
temperature: None,
|
||||
watermarking: true,
|
||||
top_p: None,
|
||||
top_k: None,
|
||||
seed: None,
|
||||
|
||||
Reference in New Issue
Block a user