Expose more arguments to control the scheduling policy (#32)

This commit is contained in:
Lianmin Zheng
2024-01-17 18:37:02 -08:00
committed by GitHub
parent c0454b323c
commit 22ec7bc2a1
4 changed files with 19 additions and 5 deletions

View File

@@ -54,7 +54,9 @@ class SglSamplingParams:
def to_vertexai_kwargs(self):
if self.regex is not None:
warnings.warn("Regular expression is not supported in the VertexAI backend.")
warnings.warn(
"Regular expression is not supported in the VertexAI backend."
)
return {
"candidate_count": 1,
"max_output_tokens": self.max_new_tokens,
@@ -67,7 +69,9 @@ class SglSamplingParams:
def to_anthropic_kwargs(self):
# Anthropic does not support frequency_penalty or presence_penalty, so we drop it here
if self.regex is not None:
warnings.warn("Regular expression is not supported in the Anthropic backend.")
warnings.warn(
"Regular expression is not supported in the Anthropic backend."
)
return {
"max_tokens_to_sample": self.max_new_tokens,
"stop_sequences": self.stop,