Skip to content

Commit b49f170

Browse files
authored
Merge branch 'main' into release/v2.13.1
2 parents 2da522a + 12ae858 commit b49f170

File tree

2 files changed

+33
-23
lines changed

2 files changed

+33
-23
lines changed

Diff for: ads/llm/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
OCIDataScienceEmbedding,
1717
)
1818
from ads.llm.langchain.plugins.llms.oci_data_science_model_deployment_endpoint import (
19+
OCIModelDeploymentLLM,
1920
OCIModelDeploymentTGI,
2021
OCIModelDeploymentVLLM,
2122
)

Diff for: ads/llm/langchain/plugins/llms/oci_data_science_model_deployment_endpoint.py

+32-23
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python
22

3-
# Copyright (c) 2024 Oracle and/or its affiliates.
3+
# Copyright (c) 2024, 2025 Oracle and/or its affiliates.
44
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
55

66

@@ -433,23 +433,6 @@ def _construct_json_body(self, prompt: str, param:dict) -> dict:
433433
model: str = DEFAULT_MODEL_NAME
434434
"""The name of the model."""
435435

436-
max_tokens: int = 256
437-
"""Denotes the number of tokens to predict per generation."""
438-
439-
temperature: float = 0.2
440-
"""A non-negative float that tunes the degree of randomness in generation."""
441-
442-
k: int = -1
443-
"""Number of most likely tokens to consider at each step."""
444-
445-
p: float = 0.75
446-
"""Total probability mass of tokens to consider at each step."""
447-
448-
best_of: int = 1
449-
"""Generates best_of completions server-side and returns the "best"
450-
(the one with the highest log probability per token).
451-
"""
452-
453436
stop: Optional[List[str]] = None
454437
"""Stop words to use when generating. Model output is cut off
455438
at the first occurrence of any of these substrings."""
@@ -466,14 +449,9 @@ def _llm_type(self) -> str:
466449
def _default_params(self) -> Dict[str, Any]:
467450
"""Get the default parameters."""
468451
return {
469-
"best_of": self.best_of,
470-
"max_tokens": self.max_tokens,
471452
"model": self.model,
472453
"stop": self.stop,
473454
"stream": self.streaming,
474-
"temperature": self.temperature,
475-
"top_k": self.k,
476-
"top_p": self.p,
477455
}
478456

479457
@property
@@ -788,6 +766,23 @@ class OCIModelDeploymentTGI(OCIModelDeploymentLLM):
788766
789767
"""
790768

769+
max_tokens: int = 256
770+
"""Denotes the number of tokens to predict per generation."""
771+
772+
temperature: float = 0.2
773+
"""A non-negative float that tunes the degree of randomness in generation."""
774+
775+
k: int = -1
776+
"""Number of most likely tokens to consider at each step."""
777+
778+
p: float = 0.75
779+
"""Total probability mass of tokens to consider at each step."""
780+
781+
best_of: int = 1
782+
"""Generates best_of completions server-side and returns the "best"
783+
(the one with the highest log probability per token).
784+
"""
785+
791786
api: Literal["/generate", "/v1/completions"] = "/v1/completions"
792787
"""Api spec."""
793788

@@ -922,6 +917,20 @@ class OCIModelDeploymentVLLM(OCIModelDeploymentLLM):
922917
923918
"""
924919

920+
max_tokens: int = 256
921+
"""Denotes the number of tokens to predict per generation."""
922+
923+
temperature: float = 0.2
924+
"""A non-negative float that tunes the degree of randomness in generation."""
925+
926+
p: float = 0.75
927+
"""Total probability mass of tokens to consider at each step."""
928+
929+
best_of: int = 1
930+
"""Generates best_of completions server-side and returns the "best"
931+
(the one with the highest log probability per token).
932+
"""
933+
925934
n: int = 1
926935
"""Number of output sequences to return for the given prompt."""
927936

0 commit comments

Comments
 (0)