dyff-client 0.2.1__tar.gz → 0.2.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {dyff-client-0.2.1/dyff_client.egg-info → dyff-client-0.2.2}/PKG-INFO +1 -1
- {dyff-client-0.2.1 → dyff-client-0.2.2}/dyff/client/client.py +77 -13
- {dyff-client-0.2.1 → dyff-client-0.2.2/dyff_client.egg-info}/PKG-INFO +1 -1
- {dyff-client-0.2.1 → dyff-client-0.2.2}/.gitignore +0 -0
- {dyff-client-0.2.1 → dyff-client-0.2.2}/.gitlab-ci.yml +0 -0
- {dyff-client-0.2.1 → dyff-client-0.2.2}/.licenserc.yaml +0 -0
- {dyff-client-0.2.1 → dyff-client-0.2.2}/.pre-commit-config.yaml +0 -0
- {dyff-client-0.2.1 → dyff-client-0.2.2}/.prettierignore +0 -0
- {dyff-client-0.2.1 → dyff-client-0.2.2}/.secrets.baseline +0 -0
- {dyff-client-0.2.1 → dyff-client-0.2.2}/CODE_OF_CONDUCT.md +0 -0
- {dyff-client-0.2.1 → dyff-client-0.2.2}/LICENSE +0 -0
- {dyff-client-0.2.1 → dyff-client-0.2.2}/NOTICE +0 -0
- {dyff-client-0.2.1 → dyff-client-0.2.2}/README.md +0 -0
- {dyff-client-0.2.1 → dyff-client-0.2.2}/dyff/client/__init__.py +0 -0
- {dyff-client-0.2.1 → dyff-client-0.2.2}/dyff/client/_generated/__init__.py +0 -0
- {dyff-client-0.2.1 → dyff-client-0.2.2}/dyff/client/_generated/_client.py +0 -0
- {dyff-client-0.2.1 → dyff-client-0.2.2}/dyff/client/_generated/_configuration.py +0 -0
- {dyff-client-0.2.1 → dyff-client-0.2.2}/dyff/client/_generated/_patch.py +0 -0
- {dyff-client-0.2.1 → dyff-client-0.2.2}/dyff/client/_generated/_serialization.py +0 -0
- {dyff-client-0.2.1 → dyff-client-0.2.2}/dyff/client/_generated/_vendor.py +0 -0
- {dyff-client-0.2.1 → dyff-client-0.2.2}/dyff/client/_generated/aio/__init__.py +0 -0
- {dyff-client-0.2.1 → dyff-client-0.2.2}/dyff/client/_generated/aio/_client.py +0 -0
- {dyff-client-0.2.1 → dyff-client-0.2.2}/dyff/client/_generated/aio/_configuration.py +0 -0
- {dyff-client-0.2.1 → dyff-client-0.2.2}/dyff/client/_generated/aio/_patch.py +0 -0
- {dyff-client-0.2.1 → dyff-client-0.2.2}/dyff/client/_generated/aio/_vendor.py +0 -0
- {dyff-client-0.2.1 → dyff-client-0.2.2}/dyff/client/_generated/aio/operations/__init__.py +0 -0
- {dyff-client-0.2.1 → dyff-client-0.2.2}/dyff/client/_generated/aio/operations/_operations.py +0 -0
- {dyff-client-0.2.1 → dyff-client-0.2.2}/dyff/client/_generated/aio/operations/_patch.py +0 -0
- {dyff-client-0.2.1 → dyff-client-0.2.2}/dyff/client/_generated/operations/__init__.py +0 -0
- {dyff-client-0.2.1 → dyff-client-0.2.2}/dyff/client/_generated/operations/_operations.py +0 -0
- {dyff-client-0.2.1 → dyff-client-0.2.2}/dyff/client/_generated/operations/_patch.py +0 -0
- {dyff-client-0.2.1 → dyff-client-0.2.2}/dyff/client/_generated/py.typed +0 -0
- {dyff-client-0.2.1 → dyff-client-0.2.2}/dyff_client.egg-info/SOURCES.txt +0 -0
- {dyff-client-0.2.1 → dyff-client-0.2.2}/dyff_client.egg-info/dependency_links.txt +0 -0
- {dyff-client-0.2.1 → dyff-client-0.2.2}/dyff_client.egg-info/requires.txt +0 -0
- {dyff-client-0.2.1 → dyff-client-0.2.2}/dyff_client.egg-info/top_level.txt +0 -0
- {dyff-client-0.2.1 → dyff-client-0.2.2}/makefile +0 -0
- {dyff-client-0.2.1 → dyff-client-0.2.2}/package-lock.json +0 -0
- {dyff-client-0.2.1 → dyff-client-0.2.2}/package.json +0 -0
- {dyff-client-0.2.1 → dyff-client-0.2.2}/pyproject.toml +0 -0
- {dyff-client-0.2.1 → dyff-client-0.2.2}/scripts/inferenceservices/databricks--dolly-v2-3b--default.py +0 -0
- {dyff-client-0.2.1 → dyff-client-0.2.2}/scripts/inferenceservices/tiiuae--falcon-7b--default.py +0 -0
- {dyff-client-0.2.1 → dyff-client-0.2.2}/scripts/models/databricks--dolly-v2-3b--rox.yaml +0 -0
- {dyff-client-0.2.1 → dyff-client-0.2.2}/scripts/models/databricks--dolly-v2-3b.py +0 -0
- {dyff-client-0.2.1 → dyff-client-0.2.2}/scripts/models/tiiuae--falcon-7b--rox.yaml +0 -0
- {dyff-client-0.2.1 → dyff-client-0.2.2}/scripts/models/tiiuae--falcon-7b.py +0 -0
- {dyff-client-0.2.1 → dyff-client-0.2.2}/setup.cfg +0 -0
- {dyff-client-0.2.1 → dyff-client-0.2.2}/tests/test_import.py +0 -0
|
@@ -9,6 +9,7 @@ import pathlib
|
|
|
9
9
|
import sys
|
|
10
10
|
from io import BytesIO
|
|
11
11
|
from typing import Any, BinaryIO, Callable, Optional, TypeVar
|
|
12
|
+
from warnings import warn
|
|
12
13
|
|
|
13
14
|
import httpx
|
|
14
15
|
import pandas
|
|
@@ -136,6 +137,15 @@ def _encode_labels(labels: Optional[dict[str, str]]) -> Optional[str]:
|
|
|
136
137
|
return json.dumps(labels)
|
|
137
138
|
|
|
138
139
|
|
|
140
|
+
def _check_deprecated_verify_ssl_certificates(
|
|
141
|
+
verify_ssl_certificates: bool, insecure: bool
|
|
142
|
+
):
|
|
143
|
+
"""Check if the deprecated parameter verify_ssl_certificates is set to insecure."""
|
|
144
|
+
# verify_ssl_certificates deprecated
|
|
145
|
+
# remove after 10/2024
|
|
146
|
+
return not verify_ssl_certificates or insecure
|
|
147
|
+
|
|
148
|
+
|
|
139
149
|
def build_audits_upload_request(
|
|
140
150
|
audit_id: str, *, file: BinaryIO, **kwargs: Any
|
|
141
151
|
) -> HttpRequest:
|
|
@@ -184,6 +194,8 @@ class InferenceSessionClient:
|
|
|
184
194
|
|
|
185
195
|
Do not instantiate this class. Create an instance using
|
|
186
196
|
:meth:`inferencesessions.client() <dyff.client.client.InferencesessionsOperations>`
|
|
197
|
+
|
|
198
|
+
`verify_ssl_certifcates` is deprecated, use `insecure` instead.
|
|
187
199
|
"""
|
|
188
200
|
|
|
189
201
|
def __init__(
|
|
@@ -196,7 +208,14 @@ class InferenceSessionClient:
|
|
|
196
208
|
input_adapter: Optional[Adapter] = None,
|
|
197
209
|
output_adapter: Optional[Adapter] = None,
|
|
198
210
|
verify_ssl_certificates: bool = True,
|
|
211
|
+
insecure: bool = False,
|
|
199
212
|
):
|
|
213
|
+
# verify_ssl_certificates deprecated
|
|
214
|
+
# remove after 10/2024
|
|
215
|
+
insecure = _check_deprecated_verify_ssl_certificates(
|
|
216
|
+
verify_ssl_certificates, insecure
|
|
217
|
+
)
|
|
218
|
+
|
|
200
219
|
self._session_id = session_id
|
|
201
220
|
self._token = token
|
|
202
221
|
self._dyff_api_endpoint = dyff_api_endpoint
|
|
@@ -206,7 +225,7 @@ class InferenceSessionClient:
|
|
|
206
225
|
self._output_adapter = output_adapter
|
|
207
226
|
|
|
208
227
|
self._client = httpx.Client(
|
|
209
|
-
timeout=httpx.Timeout(5, read=None), verify=
|
|
228
|
+
timeout=httpx.Timeout(5, read=None), verify=not insecure
|
|
210
229
|
)
|
|
211
230
|
|
|
212
231
|
def infer(self, body: Any) -> Any:
|
|
@@ -426,6 +445,8 @@ class DatasetsOperations:
|
|
|
426
445
|
|
|
427
446
|
Do not instantiate this class. Access it through the
|
|
428
447
|
``.datasets`` attribute of :class:`~dyff.client.Client`.
|
|
448
|
+
|
|
449
|
+
`verify_ssl_certifcates` is deprecated, use `insecure` instead.
|
|
429
450
|
"""
|
|
430
451
|
|
|
431
452
|
def __init__(
|
|
@@ -433,9 +454,18 @@ class DatasetsOperations:
|
|
|
433
454
|
_raw_ops: DatasetsOperationsGenerated,
|
|
434
455
|
*,
|
|
435
456
|
verify_ssl_certificates: bool = True,
|
|
457
|
+
insecure: bool = False,
|
|
436
458
|
):
|
|
437
459
|
self._raw_ops = _raw_ops
|
|
438
|
-
|
|
460
|
+
|
|
461
|
+
# verify_ssl_certificates deprecated
|
|
462
|
+
# remove after 10/2024
|
|
463
|
+
insecure = _check_deprecated_verify_ssl_certificates(
|
|
464
|
+
verify_ssl_certificates, insecure
|
|
465
|
+
)
|
|
466
|
+
|
|
467
|
+
self._verify_ssl_certificates = not insecure
|
|
468
|
+
self._insecure = insecure
|
|
439
469
|
|
|
440
470
|
def get(self, dataset_id: str) -> Dataset:
|
|
441
471
|
"""Get a Dataset by its key.
|
|
@@ -651,7 +681,7 @@ class DatasetsOperations:
|
|
|
651
681
|
put_url.url,
|
|
652
682
|
content=fin,
|
|
653
683
|
headers=headers,
|
|
654
|
-
verify=self.
|
|
684
|
+
verify=not self._insecure,
|
|
655
685
|
)
|
|
656
686
|
response.raise_for_status()
|
|
657
687
|
self._raw_ops.finalize(dataset.id)
|
|
@@ -900,6 +930,8 @@ class InferencesessionsOperations:
|
|
|
900
930
|
|
|
901
931
|
Do not instantiate this class. Access it through the
|
|
902
932
|
``.inferencesessions`` attribute of :class:`~dyff.client.Client`.
|
|
933
|
+
|
|
934
|
+
`verify_ssl_certifcates` is deprecated, use `insecure` instead.
|
|
903
935
|
"""
|
|
904
936
|
|
|
905
937
|
def __init__(
|
|
@@ -907,9 +939,18 @@ class InferencesessionsOperations:
|
|
|
907
939
|
_raw_ops: InferencesessionsOperationsGenerated,
|
|
908
940
|
*,
|
|
909
941
|
verify_ssl_certificates: bool = True,
|
|
942
|
+
insecure: bool = False,
|
|
910
943
|
):
|
|
911
944
|
self._raw_ops = _raw_ops
|
|
912
|
-
|
|
945
|
+
|
|
946
|
+
# verify_ssl_certificates deprecated
|
|
947
|
+
# remove after 10/2024
|
|
948
|
+
insecure = _check_deprecated_verify_ssl_certificates(
|
|
949
|
+
verify_ssl_certificates, insecure
|
|
950
|
+
)
|
|
951
|
+
|
|
952
|
+
self._verify_ssl_certificates = not insecure
|
|
953
|
+
self._insecure = insecure
|
|
913
954
|
|
|
914
955
|
def get(self, session_id: str) -> InferenceSession:
|
|
915
956
|
"""Get an InferenceSession by its key.
|
|
@@ -1082,7 +1123,7 @@ class InferencesessionsOperations:
|
|
|
1082
1123
|
inference_endpoint=endpoint,
|
|
1083
1124
|
input_adapter=input_adapter,
|
|
1084
1125
|
output_adapter=output_adapter,
|
|
1085
|
-
|
|
1126
|
+
insecure=self._insecure,
|
|
1086
1127
|
)
|
|
1087
1128
|
|
|
1088
1129
|
def ready(self, session_id: str) -> bool:
|
|
@@ -1240,6 +1281,8 @@ class ModulesOperations:
|
|
|
1240
1281
|
|
|
1241
1282
|
Do not instantiate this class. Access it through the
|
|
1242
1283
|
``.modules`` attribute of :class:`~dyff.client.Client`.
|
|
1284
|
+
|
|
1285
|
+
`verify_ssl_certifcates` is deprecated, use `insecure` instead.
|
|
1243
1286
|
"""
|
|
1244
1287
|
|
|
1245
1288
|
def __init__(
|
|
@@ -1247,9 +1290,18 @@ class ModulesOperations:
|
|
|
1247
1290
|
_raw_ops: ModulesOperationsGenerated,
|
|
1248
1291
|
*,
|
|
1249
1292
|
verify_ssl_certificates: bool = True,
|
|
1293
|
+
insecure: bool = False,
|
|
1250
1294
|
):
|
|
1251
1295
|
self._raw_ops = _raw_ops
|
|
1252
|
-
|
|
1296
|
+
|
|
1297
|
+
# verify_ssl_certificates deprecated
|
|
1298
|
+
# remove after 10/2024
|
|
1299
|
+
insecure = _check_deprecated_verify_ssl_certificates(
|
|
1300
|
+
verify_ssl_certificates, insecure
|
|
1301
|
+
)
|
|
1302
|
+
|
|
1303
|
+
self._verify_ssl_certificates = not insecure
|
|
1304
|
+
self._insecure = insecure
|
|
1253
1305
|
|
|
1254
1306
|
def get(self, module_id: str) -> Module:
|
|
1255
1307
|
"""Get a Module by its key.
|
|
@@ -1425,7 +1477,7 @@ class ModulesOperations:
|
|
|
1425
1477
|
put_url.url,
|
|
1426
1478
|
content=fin,
|
|
1427
1479
|
headers=headers,
|
|
1428
|
-
verify=self.
|
|
1480
|
+
verify=not self._insecure,
|
|
1429
1481
|
)
|
|
1430
1482
|
response.raise_for_status()
|
|
1431
1483
|
self._raw_ops.finalize(module.id)
|
|
@@ -1599,6 +1651,7 @@ class Client:
|
|
|
1599
1651
|
api_key: str,
|
|
1600
1652
|
endpoint: Optional[str] = None,
|
|
1601
1653
|
verify_ssl_certificates: bool = True,
|
|
1654
|
+
insecure: bool = False,
|
|
1602
1655
|
):
|
|
1603
1656
|
"""
|
|
1604
1657
|
:param str api_key: An API token to use for authentication.
|
|
@@ -1607,7 +1660,20 @@ class Client:
|
|
|
1607
1660
|
:param bool verify_ssl_certificates: You can disable certificate
|
|
1608
1661
|
verification for testing; you should do this only if you have
|
|
1609
1662
|
also changed ``endpoint`` to point to a trusted local server.
|
|
1663
|
+
|
|
1664
|
+
.. deprecated:: 0.2.2
|
|
1665
|
+
Use insecure instead
|
|
1666
|
+
:param bool insecure: Disable certificate verification for testing.
|
|
1667
|
+
you should do this only if you have
|
|
1668
|
+
also changed ``endpoint`` to point to a trusted local server.
|
|
1610
1669
|
"""
|
|
1670
|
+
if not verify_ssl_certificates:
|
|
1671
|
+
warn("verify_ssl_certificates is deprecated", DeprecationWarning)
|
|
1672
|
+
# verify_ssl_certificates deprecated
|
|
1673
|
+
# remove after 10/2024
|
|
1674
|
+
insecure = _check_deprecated_verify_ssl_certificates(
|
|
1675
|
+
verify_ssl_certificates, insecure
|
|
1676
|
+
)
|
|
1611
1677
|
|
|
1612
1678
|
if endpoint is None:
|
|
1613
1679
|
endpoint = "https://api.dyff.io/v0"
|
|
@@ -1640,26 +1706,24 @@ class Client:
|
|
|
1640
1706
|
# >> print(self._pipeline._transport.connection_config.verify)
|
|
1641
1707
|
# True
|
|
1642
1708
|
self._raw._client._pipeline._transport.connection_config.verify = ( # type: ignore
|
|
1643
|
-
|
|
1709
|
+
not insecure
|
|
1644
1710
|
)
|
|
1645
1711
|
|
|
1646
1712
|
self._audits = AuditsOperations(self._raw.audits)
|
|
1647
1713
|
self._auditprocedures = AuditproceduresOperations(self._raw.auditprocedures)
|
|
1648
|
-
self._datasets = DatasetsOperations(
|
|
1649
|
-
self._raw.datasets, verify_ssl_certificates=verify_ssl_certificates
|
|
1650
|
-
)
|
|
1714
|
+
self._datasets = DatasetsOperations(self._raw.datasets, insecure=insecure)
|
|
1651
1715
|
self._evaluations = EvaluationsOperations(self._raw.evaluations)
|
|
1652
1716
|
self._inferenceservices = InferenceservicesOperations(
|
|
1653
1717
|
self._raw.inferenceservices
|
|
1654
1718
|
)
|
|
1655
1719
|
self._inferencesessions = InferencesessionsOperations(
|
|
1656
1720
|
self._raw.inferencesessions,
|
|
1657
|
-
|
|
1721
|
+
insecure=insecure,
|
|
1658
1722
|
)
|
|
1659
1723
|
self._models = ModelsOperations(self._raw.models)
|
|
1660
1724
|
self._modules = ModulesOperations(
|
|
1661
1725
|
self._raw.modules,
|
|
1662
|
-
|
|
1726
|
+
insecure=insecure,
|
|
1663
1727
|
)
|
|
1664
1728
|
self._reports = ReportsOperations(self._raw.reports)
|
|
1665
1729
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dyff-client-0.2.1 → dyff-client-0.2.2}/dyff/client/_generated/aio/operations/_operations.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dyff-client-0.2.1 → dyff-client-0.2.2}/scripts/inferenceservices/tiiuae--falcon-7b--default.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|