Skip to content

Commit b643faa

Browse files
authored
Set defaults for optional parameters in ChatOCIModelDeploymentVLLM (#1037)
2 parents 0eba763 + 5287887 commit b643faa

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

ads/llm/langchain/plugins/chat_models/oci_data_science.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,8 @@ class ChatOCIModelDeploymentVLLM(ChatOCIModelDeployment):
769769
Science Model Deployment endpoint. See:
770770
https://docs.oracle.com/en-us/iaas/data-science/using/model-dep-policies-auth.htm#model_dep_policies_auth__predict-endpoint
771771
772+
See https://docs.vllm.ai/en/latest/api/inference_params.html for the defaults of the parameters.
773+
772774
Example:
773775
774776
.. code-block:: python
@@ -786,7 +788,7 @@ class ChatOCIModelDeploymentVLLM(ChatOCIModelDeployment):
786788
787789
""" # noqa: E501
788790

789-
frequency_penalty: float = 0.0
791+
frequency_penalty: Optional[float] = None
790792
"""Penalizes repeated tokens according to frequency. Between 0 and 1."""
791793

792794
logit_bias: Optional[Dict[str, float]] = None
@@ -798,7 +800,7 @@ class ChatOCIModelDeploymentVLLM(ChatOCIModelDeployment):
798800
n: int = 1
799801
"""Number of output sequences to return for the given prompt."""
800802

801-
presence_penalty: float = 0.0
803+
presence_penalty: Optional[float] = None
802804
"""Penalizes repeated tokens. Between 0 and 1."""
803805

804806
temperature: float = 0.2
@@ -812,7 +814,7 @@ class ChatOCIModelDeploymentVLLM(ChatOCIModelDeployment):
812814
(the one with the highest log probability per token).
813815
"""
814816

815-
use_beam_search: Optional[bool] = False
817+
use_beam_search: Optional[bool] = None
816818
"""Whether to use beam search instead of sampling."""
817819

818820
top_k: Optional[int] = -1
@@ -822,15 +824,15 @@ class ChatOCIModelDeploymentVLLM(ChatOCIModelDeployment):
822824
"""Float that represents the minimum probability for a token to be considered.
823825
Must be in [0,1]. 0 to disable this."""
824826

825-
repetition_penalty: Optional[float] = 1.0
827+
repetition_penalty: Optional[float] = None
826828
"""Float that penalizes new tokens based on their frequency in the
827829
generated text. Values > 1 encourage the model to use new tokens."""
828830

829-
length_penalty: Optional[float] = 1.0
831+
length_penalty: Optional[float] = None
830832
"""Float that penalizes sequences based on their length. Used only
831833
when `use_beam_search` is True."""
832834

833-
early_stopping: Optional[bool] = False
835+
early_stopping: Optional[bool] = None
834836
"""Controls the stopping condition for beam search. It accepts the
835837
following values: `True`, where the generation stops as soon as there
836838
are `best_of` complete candidates; `False`, where a heuristic is applied
@@ -842,7 +844,7 @@ class ChatOCIModelDeploymentVLLM(ChatOCIModelDeployment):
842844
"""Whether to ignore the EOS token and continue generating tokens after
843845
the EOS token is generated."""
844846

845-
min_tokens: Optional[int] = 0
847+
min_tokens: Optional[int] = None
846848
"""Minimum number of tokens to generate per output sequence before
847849
EOS or stop_token_ids can be generated"""
848850

@@ -851,12 +853,11 @@ class ChatOCIModelDeploymentVLLM(ChatOCIModelDeployment):
851853
The returned output will contain the stop tokens unless the stop tokens
852854
are special tokens."""
853855

854-
skip_special_tokens: Optional[bool] = True
856+
skip_special_tokens: Optional[bool] = None
855857
"""Whether to skip special tokens in the output. Defaults to True."""
856858

857-
spaces_between_special_tokens: Optional[bool] = True
858-
"""Whether to add spaces between special tokens in the output.
859-
Defaults to True."""
859+
spaces_between_special_tokens: Optional[bool] = None
860+
"""Whether to add spaces between special tokens in the output."""
860861

861862
tool_choice: Optional[str] = None
862863
"""Whether to use tool calling.

0 commit comments

Comments
 (0)