Skip to content

Commit 2e0c8ff

Browse files
authored
Add warning for unsupported config fields in batch (#111)
1 parent a0a6195 commit 2e0c8ff

File tree

1 file changed

+10
-0
lines changed
  • src/yandex_cloud_ml_sdk/_models/completions

1 file changed

+10
-0
lines changed

src/yandex_cloud_ml_sdk/_models/completions/model.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# pylint: disable=arguments-renamed,no-name-in-module,protected-access
22
from __future__ import annotations
33

4+
import warnings
45
from collections.abc import Sequence
56
from typing import TYPE_CHECKING, Any, AsyncIterator, Generic, Iterator, Literal, cast
67

@@ -141,6 +142,15 @@ def _make_request(
141142
)
142143

143144
def _make_batch_request(self, dataset_id: str) -> BatchCompletionRequest:
145+
for field in ('tools', 'response_format'):
146+
value = getattr(self.config, field)
147+
if value is not None:
148+
warnings.warn(
149+
f"The GPTModel.config.{field} is configured, "
150+
"but it is not supported in the batch run, so it will be ignored.",
151+
UserWarning, 4
152+
)
153+
144154
return BatchCompletionRequest(
145155
model_uri=self.uri,
146156
completion_options=self._make_completion_options(stream=False),

0 commit comments

Comments
 (0)