[watermark] compatibility validation (#56801)
Signed-off-by: Raphael Rialland <raphael.rialland@mistral.ai> Signed-off-by: Simon Veitner <sveitner@redhat.com> Co-authored-by: Simon Veitner <sveitner@redhat.com>
This commit is contained in:
co-authored by
Simon Veitner
parent
88f3c601b3
commit
c32495d58f
@@ -229,6 +229,7 @@ class SpeechToTextBaseServing(GenerateBaseServing):
|
||||
max_tokens=1,
|
||||
temperature=0.0,
|
||||
allowed_token_ids=allowed_token_ids,
|
||||
watermarking=False,
|
||||
)
|
||||
|
||||
result_generator = self.engine_client.generate(
|
||||
|
||||
@@ -151,6 +151,9 @@ class TranscriptionRequest(OpenAIBaseModel):
|
||||
to automatically increase the temperature until certain thresholds are hit.
|
||||
"""
|
||||
|
||||
watermarking: bool | None = None
|
||||
"""Whether to apply the engine's configured watermark to this request."""
|
||||
|
||||
top_p: float | None = None
|
||||
"""Enables nucleus (top-p) sampling, where tokens are selected from the
|
||||
smallest possible set whose cumulative probability exceeds `p`.
|
||||
@@ -226,6 +229,7 @@ class TranscriptionRequest(OpenAIBaseModel):
|
||||
beam_width=n,
|
||||
max_tokens=max_tokens,
|
||||
temperature=temperature,
|
||||
watermarking=self.watermarking,
|
||||
length_penalty=self.length_penalty,
|
||||
include_stop_str_in_output=self.include_stop_str_in_output,
|
||||
)
|
||||
@@ -264,6 +268,7 @@ class TranscriptionRequest(OpenAIBaseModel):
|
||||
|
||||
return SamplingParams.from_optional(
|
||||
temperature=temperature,
|
||||
watermarking=self.watermarking,
|
||||
max_tokens=max_tokens,
|
||||
seed=self.seed,
|
||||
top_p=top_p,
|
||||
|
||||
@@ -102,6 +102,9 @@ class TranslationRequest(OpenAIBaseModel):
|
||||
to automatically increase the temperature until certain thresholds are hit.
|
||||
"""
|
||||
|
||||
watermarking: bool | None = None
|
||||
"""Whether to apply the engine's configured watermark to this request."""
|
||||
|
||||
top_p: float | None = None
|
||||
"""Enables nucleus (top-p) sampling, where tokens are selected from the
|
||||
smallest possible set whose cumulative probability exceeds `p`.
|
||||
@@ -215,6 +218,7 @@ class TranslationRequest(OpenAIBaseModel):
|
||||
beam_width=n,
|
||||
max_tokens=max_tokens,
|
||||
temperature=temperature,
|
||||
watermarking=self.watermarking,
|
||||
length_penalty=self.length_penalty,
|
||||
include_stop_str_in_output=self.include_stop_str_in_output,
|
||||
)
|
||||
@@ -251,6 +255,7 @@ class TranslationRequest(OpenAIBaseModel):
|
||||
|
||||
return SamplingParams.from_optional(
|
||||
temperature=temperature,
|
||||
watermarking=self.watermarking,
|
||||
max_tokens=max_tokens,
|
||||
seed=self.seed,
|
||||
top_p=top_p,
|
||||
|
||||
Reference in New Issue
Block a user